Hi,

i'm having a little problem with inserting a string in a SqlServer Text
Field.
the code is in vb.net. The page produces an Object must implement
IConvertible Error.

This is the code (in short)

----------------------------------
    Private Function InsertNewMail(ByVal BodyText as string) As Integer
        Dim objConn As New
SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
        Dim ConnCmd As New SqlCommand("SP_InsertNewMail", objConn)
        ConnCmd.CommandType = CommandType.StoredProcedure

        Dim Buffer() As Byte = Encoding.ASCII.GetBytes(Bodytext)
        Dim SQLBodyText As New SqlParameter("@Bodytext", SqlDbType.Text)
        SQLBodyText.Value = buffer
        conncmd.parameters.add(SQLBodyText)

        objConn.Open()
        ConnCmd.ExecuteNonQuery()
        objConn.Close()
    End Function
----------------------------------
Thanks in advance.

Regards

Remie Bolte



---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to