Re: How do I do transactions in .Net ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Yaron,

like Jon said, these newsgroups probably aren't the best place to learn
broad topics like transaction handling, but I can give you pointers where
to start. Also, the term "transaction" can also be used in many different
contexts in programming; however I assume you are looking for information
regarding database (ADO.NET) transactions.

In ADO.NET, transactions are started with a method from the connection
class. For example, if you were accessing SQL Server, then you would use the
System.Data.SqlClient.SqlConnection class. This class has a method called
BeginTransaction which starts a transaction. This returns an object of type
SqlTransaction. Other ADO.NET connection classes like OleDbConnection has a
similar method.

After you are done, you can call the Commit method of the given
SqlTransaction object, or Rollback should you want to roll the transaction
back.

The .NET Framework SDK documentation has good information about
transactions. See the index entry "transaction processing, about transaction
processing" and the related topics form more information.

You might also find Shrijeet Nair's quick introduction helpful (from C#
Corner):
http://www.c-sharpcorner.com/Code/2002/Aug/TransactionsNConcurr.asp

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
janij@xxxxxxxxxxxxxxxxxxxxxx
http://www.saunalahti.fi/janij/


.



Relevant Pages

  • Re: SqlTransaction Record Not Found
    ... > transaction. ... >>I am using a SqlTransaction object to process a group of database insert / ... >>update statements on Sql Server 200 SP4 to complete a business process. ... >>Query Analyzer with the same Sql Select statement and the data is ...
    (microsoft.public.dotnet.framework.adonet)
  • ODBC Transaction Processing
    ... The problem I now need to solve regards transaction processing. ... And the ODBC driver provided by Transoft ... The COBOL database is not updated. ...
    (perl.dbi.users)
  • Re: Web services and transactions
    ... support distributed transaction processing. ... I think you may consider move the transaction processing from ... Encapsulate all the webmethods into a single webmethod. ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SqlTransaction Record Not Found
    ... transaction. ... select the relevant rows and return them to ... >I am using a SqlTransaction object to process a group of database insert / ... >update statements on Sql Server 200 SP4 to complete a business process. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Rollback Functions
    ... I thought that was a transaction server like a MS COM+ Server. ... the transaction processing of ADO.NET that rolls back transactions ... transaction processing Commit and Rollback abilities. ...
    (comp.programming)