Specified cast is not valid.
Posted by: Shawn Berg
Date: February 26, 2005 01:33PM

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)

Options: ReplyQuote


Subject
Written By
Posted
Specified cast is not valid.
February 26, 2005 01:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.