Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source
In directory sc8-pr-cvs1:/tmp/cvs-serv8667
Modified Files:
PGConnection.cs
Log Message:
Do not allow to execute CreateDatabase and GetDbSchemaTable if there are a DataReader open.
Index: PGConnection.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGConnection.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PGConnection.cs 12 Jul 2003 08:11:21 -0000 1.1.1.1
--- PGConnection.cs 12 Jul 2003 13:57:59 -0000 1.2
***************
*** 428,431 ****
--- 428,436 ----
public DataTable GetDbSchemaTable(PGDbSchemaType schema, object[] restrictions)
{
+ if (DataReader != null)
+ {
+ throw new InvalidOperationException("GetDbSchemaTable requires an open and available Connection. The connection's current state is Open, Fetching.");
+ }
+
IDbSchema dbSchema = PGDbSchemaFactory.GetSchema(schema);
***************
*** 447,450 ****
--- 452,460 ----
public void CreateDatabase(string database, string owner, string location, string template, string encoding)
{
+ if (DataReader != null)
+ {
+ throw new InvalidOperationException("CreateDatabase requires an open and available Connection. The connection's current state is Open, Fetching.");
+ }
+
if (database == null)
{
|