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

Recommended Answers

All 2 Replies

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)

wew it was just a comma anyway thanks again!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.