Page 1 of 1

PgsqlCommand.ExecuteReader() throws InvalidOperationException when not connected to the server

Posted: Mon 27 Jun 2005 21:08
by szinkopa
Hi,

I am just evaluating this product. Probably I will buy it.
I have found a bug in the datareader sample: PgsqlCommand.ExecuteReader() throws an InvalidOperationException when not connected to the server. It says that the connection must be opened. I think this should be handled by the library. It seems a socket error.
The exception is thrown in Common:Util:a(...).

Regards,
Szinkopa

PgsqlCommand.ExecuteReader() throws InvalidOperationException when not connected to the server

Posted: Wed 29 Jun 2005 06:56
by Yuri
This exception is raised by PostgreSQLDirect .NET if you call ExecuteReader() with closed connection.
You must open connection before calling ExecuteReader() method.

Re: PgsqlCommand.ExecuteReader() throws InvalidOperationException when not connected to the server

Posted: Wed 29 Jun 2005 13:04
by szinkopa
Ok, thanks. Is there any way to get to know what exceptions this library may throw?

PgsqlCommand.ExecuteReader() throws InvalidOperationException when not connected to the server

Posted: Wed 29 Jun 2005 13:24
by Yuri
PostgreSQLDirect.NET may throw such classes of exceptions:
PgSqlException, InvalidOperationException, FormatException, ArgumentException, NotSupportedException, ArgumentNullException, IndexOutOfRangeException.