PC Review


Reply
Thread Tools Rate Thread

ado.net begin informix transaction

 
 
kevinkliu@gmail.com
Guest
Posts: n/a
 
      10th Nov 2005
Hi,

Is there any one used the following way to open a INFORMIX transaction
in ADO.NET?

OleDbConnection conn = new OleDbConnection(connString);
OleDbCommand cmd = new OleDbCommand("Begin Work", conn);
cmd.ExecuteNonQuery();
//....Do the other works .....//
cmd = new OleDbCommand("Commit Work", conn);

Or

OleDbConnection conn = new OleDbConnection(connString);
OleDbTransaction trans = conn.BeginTransaction();
OleDbCommand cmd = new OleDbCommand("Update XXX", conn); //Please
notice that the transaction object is not passed in..
cmd.ExecuteNonQuery();
trans.Commit();

This is not followed the way how ADO.NET handles the transaction. But
it works. Does anyone know if the above code will have any problem?

Thanks.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
begin and end transaction in two different methods shari Microsoft ASP .NET 3 17th May 2007 09:35 AM
begin and end transaction in two different methods shari Microsoft ASP .NET 0 17th May 2007 02:35 AM
BEGIN TRANSACTION problem =?Utf-8?B?SmltTQ==?= Microsoft ADO .NET 7 1st Feb 2006 03:29 PM
Begin and commit transaction Ken Tucker [MVP] Microsoft VB .NET 1 15th Dec 2004 11:22 PM
Re: Is it possible to include Begin And End Transaction code in VBA ? Jean Microsoft Access Getting Started 3 29th Jun 2004 11:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:31 AM.