problem with sql statement using vb.net

Posted by newBie on Stack Overflow See other posts from Stack Overflow or by newBie
Published on 2010-06-09T03:28:17Z Indexed on 2010/06/09 3:32 UTC
Read the original article Hit count: 159

Filed under:
|

hi

i got some problem i got this 3 line statement:

Dim infoID As Integer = objCommand1.ExecuteScalar()

    Dim strSQL2 As String = "insert into feedBackHotel (infoID, feedBackView) values("   + infoID + ",'" + FeedBack + "')"

    Dim objCommand2 As New SqlCommand(strSQL2, conn)
    objCommand2.ExecuteNonQuery()

the problem here is..the strSQL2 can capture the infoID from previous statement,

but it didnt insert into the database. it will pop out this error

"Conversion from string "insert into feedBackHotel (infoI" to type 'Double' is not valid."

in both table related, use same data type (int)

but for the feedBackHotel's infoID i allow it to be null..bcoz if i make it not null, it will show another error..

im using vb.net ..can anyone help?

© Stack Overflow or respective owner

Related posts about sql

Related posts about vb.net