SQLException: incorrect syntax near '2'.

Posted by Tobechukwu Ezenachukwu on Stack Overflow See other posts from Stack Overflow or by Tobechukwu Ezenachukwu
Published on 2010-12-21T02:28:29Z Indexed on 2010/12/22 6:54 UTC
Read the original article Hit count: 213

Filed under:
|
|

whenever I call the "ExecuteNonQuery" command on the following CommandText, I get the above SQLException

myCommand.CommandText = "INSERT INTO fixtures (round_id, matchcode, date_utc, time_utc, date_london, time_london, team_A_id, team_A, team_A_country, team_B_id, team_B, team_B_country, status, gameweek, winner, fs_A, fs_B, hts_A, hts_B, ets_A, ets_B, ps_A, ps_B, last_updated) VALUES (" _
            & round_id & "," & match_id & "," & date_utc & ",'" & time_utc & "'," & date_london & ",'" & time_london & "'," & team_A_id & ",'" & team_A_name & "','" & team_A_country & "'," & team_B_id & ",'" & team_B_name & "','" & _
            team_B_country & "','" & status & "'," & gameweek & ",'" & winner & "'," & fs_A & "," & fs_B & "," & hts_A & "," & hts_B & "," & ets_A & "," & ets_B & "," & ps_A & "," & ps_B & "," & last_updated & ")"

But whenever, i remove the last table item - "last_updated", the error disappears. Please help me resolve this issue. Is there any special treatment to be given to datetime fields???

Thanks for your help

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about sql