O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required