O'Reilly logo

A Programmer's Guide to .NET by Alexei Fedorov

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

12.8. Using transactions

A transaction is a series of operations performed as single unit of work. All operations in a transaction must be completed successfully in order to make the transaction successful. The transaction has a beginning and an end that specify the boundary of the transaction. Usually we use transactions in a stored procedure with the help of BEGIN TRANSACTION and COMMIT/ROLLBACK TRANSACTION statements – these allow us to run the transaction in a single round trip to the database server.

ADO.NET supports manual transactions – we can control the transaction boundary and explicitly start and end transactions. To perform operations within a single transaction, we need to create an SqlTransaction or OleDbTransaction object and ...

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