Handling Failed Update Attempts

ADO.NET is designed to work with disconnected data. When a user modifies the contents of a DataSet, he does not directly modify the contents of the database. Instead, ADO.NET caches the change in the modified DataRow object or objects. You can submit the changes to the database later using a SqlDataAdapter object.

However, there are no guarantees that the data in the database won’t be changed after the user runs the initial query. The updating logic that SqlDataAdapter objects use to submit changes uses optimistic updating logic. As with being an optimist in life, things don’t always turn out the way you’d like.

Consider the following scenario. User A retrieves customer information from your database into a DataSet ...

Get Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition 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.