Hello,
I wanted to give some feedback about this:
The problem lies in the usage of using() for the IDbCommand (see code
below). It seems that the reader is automatically closed when the
associated DbCommand is disposed.
Everthing works fine if you write
IDbDataReader reader;
IDbCommand cmd = new FbCommand("Select * from imports where status = ;");
reader = cmd.ExecuteReader();
while(reader.Read()){
(...)
}
cmd.Dispose();
I want to emphasize, that this behavior is different from the
ADO.NET-providers for ODBC and SQLite. Is there a standard for this?
Shouldn't the FB-Provider act like the other providers?
Regards,
Thomas
Thomas Damme schrieb:
> Hello,
>
> I used the following code successfully with SQLite and ODBC:
>
> IDbDataReader reader;
> using(IDbCommand cmd = new FbCommand("Select * from imports where status
> = 0;")){
> reader = cmd.ExecuteReader();
> }
>
> while(reader.Read()){
> (...)
> }
>
> But with the Firebird.NET-driver it gives me an exception at
> while(reader.Read()), saying that the reader is closed. With the other
> drivers I just get 'false' as return value.
>
> Why is this behavior other than with the other readers? Shouldn't that
> be compatible?
>
> Or is there something I'm doing wrong?
>
> Regards,
>
> Thomas
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Firebird-net-provider mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider