0

Hey guys its me again...im having some problems modifying the data in the DataGridView

The error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where UserID='3'' at line 1

and it highlight this codie

da.Fill(ds, "tbluser")

This is my code btw..

 Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
        conn.ConnectionString = connstr

        ds = New DataSet
        da = New MySqlDataAdapter("update tbluser set  FirsName='" & txtUF.Text & "', LastName='" & txtUL.Text & "', ContactNum='" & txtUC.Text & "', Username='" & txtUser.Text & "', Password='" & txtPass.Text & "', where UserID='" & txtUid.Text & "'", conn)
        da.Fill(ds, "tbluser")
        Call showdata()
    End Sub
2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by kenomote
0

Too many commas. Remove the one before the WHERE clause as in

da = New MySqlDataAdapter("update tbluser set  FirsName='" & txtUF.Text & "', LastName='" & txtUL.Text & "', ContactNum='" & txtUC.Text & "', Username='" & txtUser.Text & "', Password='" & txtPass.Text & "'  where UserID='" & txtUid.Text & "'", conn)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.