Comparing DataSet Values Against the Database for Optimistic Concurrency
To do optimistic concurrency correctly (with 100% data integrity), you really should compare all the original data column's data values against what is in the database for your update to be considered valid (not violating optimistic concurrency). Perhaps another user has updated another column's data values for a particular data row (like the ContactName column's data value) and, at the same time, you have updated some other column's data values (like the ContactTitle column's data value). The resulting data row (after both of the updates) will have potentially mismatched data values for this particular data row (the ContactName data value doesn't correspond to the ContactTitle ...
Get Sams Teach Yourself ADO.NET in 24 Hours now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.