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

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

Postby 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
szinkopa
 

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

Postby 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.
Yuri
 
Posts: 140
Joined: Mon 08 Nov 2004 12:07

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

Postby szinkopa » Wed 29 Jun 2005 13:04

Ok, thanks. Is there any way to get to know what exceptions this library may throw?
szinkopa
 
Posts: 16
Joined: Mon 27 Jun 2005 21:12

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

Postby Yuri » Wed 29 Jun 2005 13:24

PostgreSQLDirect.NET may throw such classes of exceptions:
PgSqlException, InvalidOperationException, FormatException, ArgumentException, NotSupportedException, ArgumentNullException, IndexOutOfRangeException.
Yuri
 
Posts: 140
Joined: Mon 08 Nov 2004 12:07


Return to dotConnect for PostgreSQL