I have been working on a project for awhile now and have gotten to a point where I cannot update the database after changing it. below is a sample of my code incase anyone can see where I have gone wrong.
I have declared the database connection in another part of the program.
Dim MaxRows As Integer
Dim Sql As String
Dim da As OleDb.OleDbDataAdapter
Dim ds As New DataSet
Sql = "SELECT * FROM cardatabase"
da = New OleDb.OleDbDataAdapter(Sql, con)
Dim cb As New OleDb.OleDbCommandBuilder(da)
da.Fill(ds, "cardatabase")
MaxRows = ds.Tables("cardatabase").Rows.Count
For inc As Integer = 0 To MaxRows - 1
If LicencePLate.Text = ds.Tables("cardatabase").Rows(inc).Item(1) Then
ds.Tables("cardatabase").Rows(inc).Item(4) = "Out"
da.Update(ds, "cardatabase")
End If
Next
the error that I am getting is a syntax error on the da.Update function.
thanks

New Topic/Question
Reply



MultiQuote







|