0

Whenever I do restart the application, changes to a DataTable are never saved in the SDF database file.

Example :

_table.Clear();
_adapter.Update(_table);

Or

_table.Clear();
_adapter.Update(_dataSet);

I also tried the following but without success :

Local Data Cache Sync does not save client changes to sdf file

Thank you.

Community
  • 1
  • 1
aybe
  • 15,516
  • 9
  • 57
  • 105

1 Answers1

1

Are you attempting to delete all rows from the database?

DataTable.Clear clears all the rows from the table:

http://msdn.microsoft.com/en-us/library/system.data.datatable.clear.aspx

It doesn't mark them for deletion, which is what you would need to do to remove them on an update:

http://msdn.microsoft.com/en-us/library/feh3ed13(v=vs.80).aspx

Adam Houldsworth
  • 63,413
  • 11
  • 150
  • 187