MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology


ADO.NET Projects

ADO.NET Project 1

ADO.NET Examples


Using Transactions
Previous Home Next

There are three steps to using transactions after they are created.It is assigned to the commands that will participate in them, then the commands are executed, and finally the transaction is closed by either committing it or rolling it back.

Assigning Transactions to a Command

Once a transaction has been begun on a connection, all commands executed against that connection must participate in that transaction and if this doesn’t happen automatically—you must set the Transaction property of the command to reference the transaction.

Committing and Rolling Back Transactions

The final step in transaction, processing is to commit or roll back the changes that were made by the commands participating in the transaction. If the transaction is committed, all of the changes will be accepted in the data source. If it is rolled back, all of the changes will be discarded, and the data source will be returned to the state it was in before the transaction began. Transactions are committed using the transaction’s Commit method and rolled back using the transaction’s Rollback method.


Example: Step To Create Transactions
  1. Open the Transactions project from the Visual Studio Start Page or byusing the File menu.
  2. Double-click Transactions.cs to display the form in the form designer.
  3. Double-click Create. Visual Studio opens the code editor window and adds the Click event handler.
  4. Add the following code to the procedure.
  5. string s
  6. System.Data.OleDb.OleDbTransaction TrnNew;
  7. this.cnAccessNwind.Open();
  8. TrnNew = this.cnAccessNwind.BeginTransaction();
  9. s = "Isolation Level: ";
  10. s += TrnNew.IsolationLevel.ToString();
  11. MessageBox.Show(s);
  12. this.cnAccessNwind.Close();
  13. The code creates a new Transaction using the default method, and then displays its IsolationLevel in a message box.
  14. Press F5 to run the application.
Previous Home Next