From:
<car...@te...> - 2004-05-04 08:59:57
|
Hello: >Could someone shed some light on implicit transactions (when using FBCommand >for example)... > It's simply that a transaction is not needed for execute commands (unless there are a explicit transaction started using FbConnection.BeginTransaction): FbConnection connection = new FbConnection(connectionString); connection.Open(); string sql = "SELECT * FROM EMPLOYEE"; /* note that there are no transaction asseigned to the command object */ FbCommand command = new FbCommand(sql, connection); FbDataReader reader = command.ExecuteReader(); while (reader.Read()) { .... } reader.Close(); command.Dispose(); connection.Close(); The samples uses ExecuteReader but the same can be made with ExecuteNonQuery and ExecuteScalar (or with commands used with the DataAdapter). The implicit transaction support will work better in version 1.6. -- Best regards Carlos Guzmán Álvarez Vigo-Spain |