David Carter

David Carter

  • NA
  • 86
  • 22.3k

Update not saving.

Aug 7 2010 7:30 AM

Thanks for your help in the past; Queries are now working and the output is fine.
Now my Updating command for the Database is playing with my mind. :-(
The following code appears to work. I can even close the program and restart it, noting that the changes appear to have been saved.

Try

Me.Validate()
Me.ProductAndUsesBindingSource1.EndEdit()
Me.Product_and_UsesTableAdapter1.Update(Me.DataSet1.Product_and_Uses)
MsgBox(" Update successful")
Catch ex As Exception
MsgBox(" Update failed")
End Try
I get the Update Successful message but then later I come into the program and the changes have disappeared.
It's like the changes have been held in a temporary file but not updated the main database.
My reading tells me that the EndEdit should have fixed the problem but it hasn't.
I've tried using Me.Product_and_UsesTableAdapter1.Update(me.Dataset1) without the .Product_and_Uses, but that doesn't make a difference.
Thank you for your assistance.
David
 
 

Answers (10)