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
Briefly explain how the server control validation controls work? A validation control works by evaluating the value of an input server control on the page to see whether it mee

Question: (a) Outline four classes that allow you to work with File Streams. (b) (i) What potential problem can arise when you change items stored in an Application State

Need to copy values from one database to another AND Enhancements in MVC website. Project Description: Basically, you are asked to create an app that copy values from one DB

Project Description: I am looking an app that mimics this app presently available here [justremotephone.com]. It has a nice set of features but also lacks a lot when it comes to

Want C# Single User Login per session Project Description: I need to save simulatenious logins for one account such as one user has a spottily premium account and someone tri

What is cloud computing? The cloud computing is the computing which is completely based on the Internet. It can also be explained as the next stage in the evolution of the Inte

What is Delegation? A delegate seems like a strongly type function pointer. Delegates can request the methods that they reference without making explicit calls to those methods

Name the two properties of the GridView control that have to be specified to turn on sorting and paging. The properties of the GridView control that require to be specified to

What precautions we need to take while deploying satellite assemblies? When we distribute the assembly, the folder structure has to be very organized. The table below shows how

We need in ASP.NET Mvc site I have project should be done with MVC.NET technology. In general- I have by now the site Layout (Html-js-css) I need- a) Simple CMS allo