From: Jan J. <ja...@uv...> - 2003-07-06 09:46:48
|
Hi, I am playing around with the .Net driver which works just fine. But I would like to mention that I have found an error in the example showing how to use the FbDataReader. The connection must be active before you can start a transaction. Regards Jan Jensen string mySelectQuery = "SELECT dept_no, departament FROM departament"; FbConnection myConnection = new FblConnection(myConnString); FbTransaction myTxn = myConnection.BeginTransaction(); FbCommand myCommand = new FbCommand(mySelectQuery, myConnection, myTxn); myConnection.Open(); //Error - move up! FbDataReader myReader; myReader = myCommand.ExecuteReader(); // Always call Read before accessing data. while (myReader.Read()) { Console.WriteLine(myReader.GetInt32(0) + ", " + myReader.GetString(1)); } // always call Close when done reading. myReader.Close(); // Close the connection when done with it. myConnection.Close(); } |