From:
<car...@te...> - 2003-02-04 15:09:57
|
Hello: > can i use 2 fbCommands with one fbConnection and one fbTransaction > or > have i create separate connection or transaction for each fbCommand??? > > this example throws exception: > FbConnection dbConn = new FbConnection(fConnString); > try { > dbConn.Open(); > > FbTransaction dbTran = dbConn.BeginTransaction(); > if (fID < 0) { > string genQuery = "SELECT GEN_ID(GENARTICLEID, 1) FROM > RDB$DATABASE"; > FbCommand dbCmd2 = new FbCommand(genQuery, dbConn, dbTran); > dbCmd2.ExecuteScalar(); > } > FbCommand dbCmd = new FbCommand(query, dbConn, dbTran); > > dbCmd.Prepare(); > dbCmd.Parameters.Add("xID", fID); > dbCmd.ExecuteNonQuery(); > dbTran.Commit(); > } > finally { > dbConn.Close(); > } I going to see it , one question are you testing with CVS sources?? In older versions there a error when using ExecutingScalar that is fixed in CVS. Best regards Carlos Guzmán Álvarez Vigo-Spain |