Re: ado.net begin informix transaction
Posted in 2005
Topics: General Discussion
The second is the correct way of doing it. Why are you not using the Informix .NET provider classes to achieve the same? Venkatesh. "kliu" <kevinkliu@gmail.com> Sent by: owner-informix-list@iiug.org 11/10/2005 05:23 PM Please respond to "kliu" To: informix-list@iiug.org cc: Subject: ado.net begin informix transaction 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. sending to informix-list