Results 1 to 2 of 2

Thread: SQL INSERT in VB.NET

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2003
    Posts
    28

    SQL INSERT in VB.NET

    Can anyone tell me what I am doing wrong with this statement ?

    Dim MyCommand As New OleDbCommand("INSERT INTO tblQuestion(QuestionType,UserID,QuestionID) VALUES ('VERB', '2', ' "& num &" ')", dbconn)

    I am reading some values from the form and some constants.
    IS the formatting correct ? If I get rid of the double quotes around (' " & num &" ' ) , the SQL query doesn't execute...if I put them, it doesn't compile and says comma or end expected after the double quotes.
    Thanks for your time
    Regards --
    Vujjeni

  2. #2
    Lively Member
    Join Date
    Mar 2002
    Posts
    96
    If num is in fact a number than do not put tic marks in the quotes, should just be like this
    ...," & num & " )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width