Reputation: 19
I have a SYNTAX error in the UPDATE statement. Plz Help.
cmd.CommandText = "UPDATE tbl_User SET ([Score], [Level])VALUES(@User_Score, @User_Level) WHERE User=@User"
cmd.Parameters.AddWithValue("@User_Score", lblScore.Text)
cmd.Parameters.AddWithValue("@User_Level", lblLevel.Text)
cmd.Parameters.AddWithValue("@User", txtUser.Text)
Thanks
Upvotes: 0
Views: 66
Reputation: 19
cmd.CommandText = "UPDATE tbl_User " & vbCrLf & "SET User_Score=@User_Score," & vbCrLf & "User_Level=@User_Level" & vbCrLf & "WHERE User=@User"
Upvotes: 0
Reputation: 239636
You're using the INSERT
syntax style, not the UPDATE
syntax:
UPDATE tbl_User SET [Score] = @User_Score, [Level]= @User_Level WHERE User=@User
Upvotes: 1