How can we perform transactions in .NET?

How can we perform transactions in .NET?

Following are the general steps that are followed during a transaction:

1. Open connection.
2. Begin Transaction : The begin transaction method provides with a connection object this can be used to commit or rollback.
3. Execute the SQL commands.
4. Commit or roll back.
5. Close the database connection.

How can we perform transactions in .NET?

Steps to perform a transaction

1. Call the BeginTransaction. This marks the beginning of the transaction.
2. Assign the Transaction object returned by BeginTransaction to the Transaction property of the SqlCommand.
3. Execute the command.
4. Call the Commit method from SqlTransaction object to save the changes made to the data through the transaction. Call Rollback undo all the transaction which belong to this transaction.
Command objects uses, purposes and their methods.
The command objects are used to connect to the Datareader or dataset objects with the help of the following methods.....
Difference between dataset and datareader.
DataSet object can contain multiple rowsets from the same data source as well as from the relationships between them.......
.NET Mobile overview
.NET Mobile overview - .NET Mobile is a platform for developing applications for mobile phones. It’s an extension to .NET Framework and is called Microsoft Mobile Internet Toolkit.......
Post your comment