Exception when get DataSourceInformation from ADO.NET

Report PGNP bugs.

Exception when get DataSourceInformation from ADO.NET

Postby rtgreen » Tue Sep 11, 2012 7:41 am

Hello!

I work with PostgreSQL 9.2 at Windows 7 x86. In attempt to receive DataSourceInformation through ADO.NET OLE DB PGNP provider I receive System.InvalidCastException exception.

Code on C#:

Code: Select all
OleDbConnection connection = new OleDbConnection();
connection.ConnectionString = "Provider=PGNP.1;Password=REACT;Persist Security Info=True;User ID=postgres;Initial Catalog=InternetDB;Data Source=localhost;Extended Properties=\"SSL=allow;\"";
connection.Open();           
DataTable table = connection.GetSchema("DataSourceInformation");
connection.Close();


Generates an exception:

Code: Select all
System.InvalidCastException: Specified cast is not valid.
   at System.Data.OleDb.OleDbMetaDataFactory.GetDataSourceInformationTable(OleDbConnection connection, OleDbConnectionInternal internalConnection)
   at System.Data.OleDb.OleDbMetaDataFactory.PrepareCollection(String collection
Name, String[] restrictions, DbConnection connection)
   at System.Data.ProviderBase.DbMetaDataFactory.GetSchema(DbConnection connection, String collectionName, String[] restrictions)
   at System.Data.ProviderBase.DbConnectionInternal.GetSchema(DbConnectionFactory factory, DbConnectionPoolGroup poolGroup, DbConnection outerConnection, String collectionName, String[] restrictions)
   at System.Data.OleDb.OleDbConnection.GetSchema(String collectionName, String[] restrictionValues)
   at System.Data.OleDb.OleDbConnection.GetSchema(String collectionName)
   at ConsoleApplication1.Program.Main(String[] args)


Provider PGNP-Postgres-SE-Trial-1.4.0.3076.exe (trial)

Anyone knows how to fix it?

Thanks.
rtgreen
 
Posts: 1
Joined: Tue Sep 11, 2012 7:33 am

Re: Exception when get DataSourceInformation from ADO.NET

Postby Moderator » Thu Sep 13, 2012 12:14 am

Thank you for reporting this bug. It was caused by a missing property in the OLEDB DataSource object. We have already fixed it. We are preparing new release of the provider, which will be available in a few days.
User avatar
Moderator
Site Admin
 
Posts: 305
Joined: Wed Oct 29, 2008 11:27 pm


Return to Report Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron