From: Zarko G. <del...@ab...> - 2004-05-04 09:20:55
|
Carlos, thanks. BTW, when do I need (must) to use explicit transactions? ............................................. Zarko Gajic, webmaster to aspxDelphi.net - bringing the world of ASP.NET to Delphi developers http://www.aspxdelphi.net email: web...@as... ............................................. "Carlos Guzmán Álvarez" <car...@te...> wrote in message news:409...@te...... > 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 > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Firebird-net-provider mailing list > Fir...@li... > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider > |