O'Reilly logo

Application Development Using Visual Basic® and .NET by Dana L. Wyatt, Peter Thorsteinson, Robert J. Oberg

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

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

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