Syntax error in UPDATE statement

The following code generates an error and I am not sure why. Anyone have any ideas?

cmdString2 = string.Format( "UPDATE USERS SET password='" & txtConfirmPassword.Text & "' WHERE username='" & dtrResults("username") & "'")

cmdUpdate = New OleDbCommand( cmdString2, conLogin2 )

conLogin2.Open()
cmdUpdate.ExecuteNonQuery()
conLogin2.Close()

When I display the update statement it looks like this:

UPDATE USERS SET password='pswrd' WHERE username='usrname'

I am pretty sure that is ok, but it errors out on the line cmdUpdate.ExecuteNonQuery()

Thank you for any advice.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories