|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ado.net begin informix transactionIs 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. |
|||||||||||||||||||||||