From: Pavol S. <pa...@st...> - 2003-02-05 11:36:06
|
Carlos Guzm=E1n =C1lvarez wrote: > 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 =3D new FbConnection(fConnString); >> try { >> dbConn.Open(); >> FbTransaction dbTran =3D dbConn.BeginTransaction(); >> if (fID < 0) { >> string genQuery =3D "SELECT GEN_ID(GENARTICLEID, 1) FROM=20 >> RDB$DATABASE"; >> FbCommand dbCmd2 =3D new FbCommand(genQuery, dbConn, dbTran); >> dbCmd2.ExecuteScalar(); >> } >> FbCommand dbCmd =3D 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=20 > older versions there a error when using ExecutingScalar that is fixed i= n > CVS. > i think, that ExecuteSclalar is working fine , but when i use same=20 connection and transaction for two different commands there is=20 exception, that transactions in trans and conn are different... I will=20 try it with your build... Again thanx for that... by the way... I wan to help you improve helps, so i will send you=20 modified xml files... and you said that you implemented named parameters??? I was looking for=20 that in sources yesterday but i didnt find it :( p. |