Hey, I face a problem in updating data to the original database.

Everytime when I clicked the update button. an error came out in the coding where I highlighted below, saying syntax error in update statement!

Can somebody please pin-point my mistake?:'(

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
         Me.JigTableAdapter.Fill(Me.JigDataSet.jig)

        con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\jig.mdb"
        con.Open()

        sql = "SELECT * FROM jig"
        da = New OleDb.OleDbDataAdapter(sql, con)

        da.Fill(ds, "jig")
        con.Close()

        MaxRows = ds.Tables("jig").Rows.Count
        inc = 0

    End Sub

Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
        Dim cb As New OleDb.OleDbCommandBuilder(da)

        ds.Tables("jig").Rows(inc).Item(0) = JIG_NOTextBox.Text()
        ds.Tables("jig").Rows(inc).Item(1) = JIG_NAMETextBox.Text()
        ds.Tables("jig").Rows(inc).Item(2) = JIG_MODELTextBox.Text()
        
[I]        da.Update(ds, "jig")[/I]

        MsgBox("Data updated!")

    End Sub

Please wrap your code in code tags.

I think you have to explicitly define an update command for the data adapter.

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.