Transactions in ADO.NET
Transactions are groups of database commands that execute as a package. Using a transaction gives your application the ability to abort (roll back) all changes executed from within the transaction if any errors occur during any part of the transaction process. For example, consider an application with two tables, where one table represents inventory and the other represents orders. When an order is added to one table, the corresponding inventory needs to reduced in the other table. If an update to the Orders table was successful and an update to the Inventory table failed, the integrity of your data would be compromised. In order to guarantee that both tables were updated successfully, you could package both data commands into a single transaction. If one table updated successfully and the other table did not, you can rollback the entire transaction, resolve the issues that caused the failure, and re-attempt the transaction again.
Note Your underlying data source must support transactions in order to use the transaction features supported in Visual Studio .NET.
Transactions are created by calling the BeginTransaction method of a data connection object. For more information, see Performing Transactions.