Database Transactions and Updates

When the data adapter updates the data source, it is not done as a single transaction. If you want all the inserts, updates, and deletes done in one transaction, you must handle the transaction programmatically.

The SqlConnection object has a BeginTransaction method that returns a SqlTransaction object. When you invoke the BeginTransaction method, you can optionally specify the isolation level. If you know what you are doing, and understand the tradeoffs, you can improve the performance and scalability of your application by setting the appropriate isolation level. If you set the isolation level incorrectly or inappropriately, you can have inconsistent or incorrect data results.[5]

[5] Discussing isolation levels ...

Get Application Development Using Visual Basic® and .NET 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.