0

When I try to update a database with some modified values in a dataset, a concurrence exception doesn't raise if i change manually some values in the database after the fill method on the dataset is performed. (I only get the exception if I delete a row manually and then I try call the method update of data adapter).

How should I check if I have a "dirty read" on my dataset?.

1 Answers1

0

You have several options.

  • Keeping a copy of the original entity set to compare against and make the is dirty determination at the point you need to know whether it's dirty.

  • Checking the datarow's rowstate property and if Modified compare the values in the Current and Original DataRowVersions. If the second change makes the value the same as the original then you could call RejectChanges, however that would reject all changes on the row. You will have to manually track each field since the dataset only keeps per-row or per-table changes.

William Xifaras
  • 5,212
  • 2
  • 19
  • 21