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

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
szinkopa

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

Post by szinkopa » Mon 27 Jun 2005 21:08

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

Yuri
Posts: 140
Joined: Mon 08 Nov 2004 12:07

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

Post by Yuri » Wed 29 Jun 2005 06:56

This exception is raised by PostgreSQLDirect .NET if you call ExecuteReader() with closed connection.
You must open connection before calling ExecuteReader() method.

szinkopa
Posts: 16
Joined: Mon 27 Jun 2005 21:12

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

Post by szinkopa » Wed 29 Jun 2005 13:04

Ok, thanks. Is there any way to get to know what exceptions this library may throw?

Yuri
Posts: 140
Joined: Mon 08 Nov 2004 12:07

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

Post by Yuri » Wed 29 Jun 2005 13:24

PostgreSQLDirect.NET may throw such classes of exceptions:
PgSqlException, InvalidOperationException, FormatException, ArgumentException, NotSupportedException, ArgumentNullException, IndexOutOfRangeException.

Post Reply