Perform transactions in .net, DOT NET Programming

How can we perform transactions in .NET?

The common sequence of steps that would be performed for developing a transactional application is as follows:

1)In the first step open a database connection by using the Open method of the connection object.

2)In the second begin a transaction by using the Begin Transaction method of the connection object. This method gives us with a transaction object that we will use later to commit or rollback the transaction. Keep in mind that changes caused by any queries executed before calling the Begin Transaction method will be committed to the database immediately after they execute. Now Set the Transaction property of the command object to the above mentioned transaction object.

3)In the third step execute the SQL commands by using the command object. We can use one or more command objects for this purpose, as long as the Transaction property of all the objects is set to a valid transaction object.

4)In the fourth step roll back or commit the transaction by using the Commit or Rollback method of the transaction object.

5)At last close the database connection.

Posted Date: 9/24/2012 5:08:51 AM | Location : United States







Related Discussions:- Perform transactions in .net, Assignment Help, Ask Question on Perform transactions in .net, Get Answer, Expert's Help, Perform transactions in .net Discussions

Write discussion on Perform transactions in .net
Your posts are moderated
Related Questions
Google Calendar Project Description: I require to syn my Microsoft exchange calendar with the Google calendar so i will view the all the changes that happen in Microsoft exch

What is the use of data adapter? The Data adapter are the objects that connect one or more Command objects to a Dataset object. They give logic that would get data from the dat

Explain the concept of Bookmarks in WF 4.0. In WF 4.0, a bookmark is a mechanism that enables an activity to wait for an input without interrupting a workflow thread. When an a

What I need is the following: I need an implementation in matlab under windows to open a named pipe and to read data from the pipe (an other program writes into the pipe) in quasi

What are LINQ query expressions? A LINQ query, also known as a query expression, having of a combination of query clauses that identify the data sources for the query. It conta

What is Object Oriented Programming? This is a problem solving process to develop software systems. This is a technique to think real world in terms of objects. The Object maps

I need help in Web application that will run stand alone in IIS (MS SQL) 2 activities / Tasks Code web user management module (create user, assign license, simple authorizati

Bug Prediction and Correction Project Description: The project is about the prediction of bugs and fixes the bug in the sample program using costriage algorithm. All the requ

Can you define what inheritance is and an example of when you might use it? The process of deriving a new class from an existing class is known as Inheritance. The old class is

How do we access view state value of the page in the next page? The View state is page specific; it contains information about controls embedded at the particular page. ASP.NET