Skip Navigation LinksHome > Categories > Code from a Category

Transactions in ADO.Net

User Name: codelecturer
Name: Mike Chauhan
Contact Me:
Home Page:
6 years of total IT experience including programming, application development, System Maintenance . 3 years of Experienced and expertise in .Net Framework VB, Visual Basic.Net, ASP.Net 2.0, 3.5 and AD... [More]
Viewed Times: 1182
Add Date: 10/12/2012
In this article i will explain how transactions will work in ADO.Net
This article provides you the basic insight about the Transactions in ADO.NET. The ADO.NET provides you to implement the transaction while executing statements across the Data Base from front end code. We will discuss the topic, what is a Transaction?. How can we Implement Transaction in ADO.NET.

What is a Transaction?.

We can say, Transactions are Data Base commands that execute as set of package. For Example if we have two statements if first statement fails second statement should not execute or if first statement executes success and second statement failed, now inserted records should be rolled back.

Transactions are very much powerful and efficient means of performance in .NET. We are having three types of blocks are there in ADO.NET Transactions.

1) Begin Transaction
2) Commit Transaction
3) Roll Back Transaction

Below is the sample program to use the Transaction in ADO.NET.


C# Code


SqlTransaction is class Which represents a Transact SQL transaction to be made in SQL Server Data Base. It is derived from the System.Data.SqlClient namespace.

Happy Programming!!!

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.