I am trying to update an Access database after editing a field and am getting the error - syntax error in update statement. My app is pretty simple - I have put text boxes on a form and bound these to all of the fields of the database... Im new to ado.net. The only coding I have at this stage is for the navigating the rows of the table, adding and deleting.
Funnily enough, my update button works after I delete a record - but not after I make an edit. Curiously my dataset (dsMovies1) reports changes through the HasChanges method....
My dataset is called dsMovies1 and the database table is called Movies.
The data adapter is called odaMovies.
I have pasted my update code below:
Any help would be appreciated!!
Funnily enough, my update button works after I delete a record - but not after I make an edit. Curiously my dataset (dsMovies1) reports changes through the HasChanges method....
My dataset is called dsMovies1 and the database table is called Movies.
The data adapter is called odaMovies.
I have pasted my update code below:
Code:
If dsMovies1.HasChanges Then
Try
Dim NumberChanged As Integer
NumberChanged = odaMovies.Update(dsMovies1.Movies)
MessageBox.Show("Updated: " & NumberChanged, "Update succeeded!")
Catch ex As Exception
MessageBox.Show(ex.Message, "Update failed!")
End Try
Else
MessageBox.Show("No changes to submit!", "SubmitChanges")
End If
Any help would be appreciated!!