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
Project Description: We require an expert developer to work on several projects for our company. You will be managed by our senior developer. Required - MUST be proficient in

What is DISCO? The Web Service Description Language (WSDL) is a W3C specification which defines the XML grammar for describing the Web Services.XML grammar describes details li

What is CMMI? This is a collection of instructions an organization can follow with the purpose to gain the better control over its software development process. According to

Project Description: Simple task on analysis svn and github .NET, PHP, Engineering, Software Architecture

Why do we use the XMLHttpRequest object in AJAX? The XMLHttpRequest object is used by JavaScript to transfer XML and other text data among client and server. The XMLHttpRequest

What is a static constructor? Static constructors are introduced with C# to initialize the static data of a class. CLR calls the static constructor before the initial instance

How does CAS works? There are two key methods of CAS security policy- code groups and permissions. A code group contains assemblies in it in a manner that each .NET assembly is

Ask question #Minimum 100 words accepWrite an ASP.NET program that allows you to create and populate a CheckBoxList control by accessing the Title field from the Movies database ta

Counting Number of Words in a String - C# Program Anyone can suggest me the output of the following program. using System;   class CountWords { public static void

Project Description: We are seeking Mobile game developer for long time our budget is per project Skills required: Mobile Phone, .NET