punjabtechnicaluniversity.blogspot.in
The most common sequence of steps that would be performed while developing a transactional application is as follows:
1.Open a database connection using the Open method of the connection object.
4. Commit or roll back the transaction using the Commit or Rollback method of the transaction object.
5. Close the database connection.
The most common sequence of steps that would be performed while developing a transactional application is as follows:
1.Open a database connection using the Open method of the connection object.
2. Begin a transaction using the Begin Transaction method of the connection object. This method provides us with a transaction object that we will use later to commit or rollback the transaction. Note that changes caused by any queries executed before calling the Begin Transaction method will be committed to the database immediately after they execute.Set the Transaction property of the command object to the above mentioned transaction object.
3. Execute the SQL commands using the command object. We may 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. Commit or roll back the transaction using the Commit or Rollback method of the transaction object.
5. Close the database connection.
0 comments:
Post a Comment
North India Campus