S
Shawn Berg
The following code is generating the error "Specified cast is not valid."
Can anyone help? I have commented above the line that is generating this
error. The _subject variable is a String data type.
Dim CmdText As String, CmdParams(2) As MySqlParameter
'Save email campaign to data store
CmdText = "INSERT INTO tblEmailCampaigns (subject, body, d_t) " & _
"VALUES (?, ?, ?)"
'THE LINE BELOW IS GENERATING THIS ERROR:
CmdParams(0) = New MySqlParameter("@subject", MySqlDbType.VarChar,
100).Value = _subject
CmdParams(1) = New MySqlParameter("@body", MySqlDbType.VarChar,
999999999).Value = _body
CmdParams(2) = New MySqlParameter("@d_t", MySqlDbType.Datetime).Value =
Date.Now
MySqlHelper.ExecuteNonQuery(ConfigurationSettings.AppSettings("cnTSR1"),
CmdText, CmdParams)
Can anyone help? I have commented above the line that is generating this
error. The _subject variable is a String data type.
Dim CmdText As String, CmdParams(2) As MySqlParameter
'Save email campaign to data store
CmdText = "INSERT INTO tblEmailCampaigns (subject, body, d_t) " & _
"VALUES (?, ?, ?)"
'THE LINE BELOW IS GENERATING THIS ERROR:
CmdParams(0) = New MySqlParameter("@subject", MySqlDbType.VarChar,
100).Value = _subject
CmdParams(1) = New MySqlParameter("@body", MySqlDbType.VarChar,
999999999).Value = _body
CmdParams(2) = New MySqlParameter("@d_t", MySqlDbType.Datetime).Value =
Date.Now
MySqlHelper.ExecuteNonQuery(ConfigurationSettings.AppSettings("cnTSR1"),
CmdText, CmdParams)