From: <car...@te...> - 2003-03-04 17:32:49
|
Hello: > as you wish, you are master... :) Ok but i want to clarify a little why i don't like this: 1.- I think that use Dispose calls is the rigth way for free resources in .NET. 2.- Now with the Provider you use commands across transactions, an example ( for explain it better :P ): FbTransaction myTransaction; FbConnection myConnection = new FbConnection(connectionString); myConnection.Open(); FbCommand myCommand = new FbCommand("UPDATE TEST_TABLE_01 SET CHAR_FIELD = ? WHERE INT_FIELD = 1", myConnection); myCommand.Parameters.Add("@INT_FIELD", FbType.VarChar, "INT_FIELD"); // Start a new transaction and execute the query myCommand.Parameters[0].Value = "test"; myTransaction = myConnection.BeginTransaction(); myCommand.Transaction = myTransaction; myCommand.ExecuteNonQuery(); myTransaction.Commit(); // Start a new transaction and execute the query myCommand.Parameters[0].Value = "test__"; myTransaction = myConnection.BeginTransaction(); myCommand.Transaction = myTransaction; myCommand.ExecuteNonQuery(); myTransaction.Commit(); myConnection.Close(); As you can see in this example i'm executing the same query using two different transactions :) -- Best regards Carlos Guzmán Álvarez Vigo-Spain "No tengo dones especiales.Sólo soy apasionadamente curioso" Albert Einstein, científico. |