I have been pulling my hair out over this one, please help.
I have a simple database called ContactsDB that is bound to a DataGrid and I can't get any changes to save back to the database. Right now just for testing purposes I have a save button that executes the c# function below. I receive the 'update successful' dialog message but when I open the database in Access it is still the same (no saved changes).
public void ButContactsSave(object sender, RoutedEventArgs e)
{
try
{
var dataset = new ContactsDB();
var adapter = new ContactsDBTableAdapters.ContactsTableAdapter();
adapter.Fill(dataset.Contacts);
dataset.AcceptChanges();
adapter.Update(dataset.Contacts);
MessageBox.Show("Update successful");
}
catch (System.Exception ex)
{
MessageBox.Show("Update failed");
}
}