From: Mark E. S. Jr. <ms...@sc...> - 2003-02-10 20:01:09
|
I'm working with a downloaded copy of Firebird (downloaded less than two weeks ago from sourceforge), on a WinXP box. I'm able to work with the server just fine, have imported a large amount of data, used the ODBC driver to import data from Access with success. However, I have not been able to get a driver working well in .NET either version 1.0 or 1.1. When using the FirebirdSql.Data.Firebird drivers, it usually works the first time, but after that, I get sometimes a SQL error with a code -104, and after that it starts just telling me "Error reading data from the connection" on the line where I call the DataAdapter.Fill function. I haven't seen somebody using a DataAdapter in the way that I am, so I'm wondering if its just a DataAdapter issue. Below you can see the example code I'm testing with. After I get the data I'm just piping out out to XML. string sSQL = "SELECT * FROM INVOICERECEIPT_HEADER WHERE POSTHEADID=8220;"; FbConnection conn = new FbConnection("Database=D:\Program Files\Firebird\data\test.gdb;User=test_user;Password=zipper;Dialect=3;Se rver=localhost;Role=authors"); FbCommand cmd = new FbCommand(sSQL, conn); cmd.CommandType = CommandType.Text; FbDataAdapter da = new FbDataAdapter(cmd); DataSet ds = new DataSet("InvoiceReceipt"); conn.Open(); FbTransaction trans = conn.BeginTransaction(); cmd.Transaction = trans; da.Fill(ds, 0, 0, "Header"); trans.Commit(); conn.Close(); Like I said, it seems to work the first time especially after a reboot, sometimes it will work a second time, but after that I get the SQL -104 error, and after that I just keep getting "Error reading data from the connection". Is there something I'm doing wrong? The only thing I had to add over the documentation in the help files is the Transaction code. It would not allow me to execute anything without first making a transaction. Thanks! Mark E. Scott Jr. ms...@sc... P.S. I was originally using the compiled DLL from the site, and have now downloaded the latest source from CVS and included it in my Visual Studio project so I could perhaps use the debugger and look through whats happening. Haven't had time to do that yet. |
From:
<car...@te...> - 2003-02-10 20:35:29
|
Hello: > Like I said, it seems to work the first time especially after a reboot, > sometimes it will work a second time, but after that I get the SQL -104 > error, and after that I just keep getting "Error reading data from the > connection". I'm testing you sample code without problems :( > Is there something I'm doing wrong? Nothing. > The only thing I had to add over > the documentation in the help files is the Transaction code. It would > not allow me to execute anything without first making a transaction. Some questions: - Are you testing using Firebird 1.0 or Firebird 1.5 ?? - Your test database have blob fields ?? Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: Mark E. S. Jr. <ms...@sc...> - 2003-02-10 20:44:19
|
No Blobs fields, but I am running the 1.02 release version, I was antsy about running a non release version. I will now try and upgrade to see if that helps. Thank you very much. Mark E. Scott Jr. ms...@sc... -----Original Message----- From: Carlos Guzm=E1n =C1lvarez [mailto:car...@te...]=20 Sent: Monday, February 10, 2003 2:42 PM To: Mark E. Scott Jr. Cc: fir...@li... Subject: Re: [Firebird-net-provider] Possible DataAdapter Problem Hello: > Like I said, it seems to work the first time especially after a reboot, > sometimes it will work a second time, but after that I get the SQL -104 > error, and after that I just keep getting "Error reading data from the > connection". I'm testing you sample code without problems :( > Is there something I'm doing wrong? =20 Nothing. > The only thing I had to add over > the documentation in the help files is the Transaction code. It would > not allow me to execute anything without first making a transaction. Some questions: - Are you testing using Firebird 1.0 or Firebird 1.5 ?? - Your test database have blob fields ?? Best regards Carlos Guzm=E1n =C1lvarez Vigo-Spain |
From: <car...@te...> - 2003-02-10 20:50:02
|
Hello: > No Blobs fields, but I am running the 1.02 release version, I was antsy > about running a non release version. I ask the server version because i run the test using Fb 1.02 I have modified your sample code as: string sSQL = "SELECT * FROM INVOICERECEIPT_HEADER WHERE POSTHEADID=8220;"; for (int i = 0; i < 10; i++) { FbConnection conn = new FbConnection(@"Database=D:\Program Files\Firebird\data\test.gdb;User=test_user;Password=zipper;Dialect=3;Server=localhost;Role=authors"); FbCommand cmd = new FbCommand(sSQL, conn); cmd.CommandType = CommandType.Text; FbDataAdapter da = new FbDataAdapter(cmd); DataSet ds = new DataSet("InvoiceReceipt"); conn.Open(); FbTransaction trans = conn.BeginTransaction(); cmd.Transaction = trans; da.Fill(ds, 0, 0, "Header"); trans.Commit(); conn.Close(); } But with connection string changed for use a own database, etc..., it this correct test or not??. Best regards Carlos Guzmán Álvarez Vigo-Spain |