Exception when get DataSourceInformation from ADO.NET

9 years 2 months ago #6683 by rtgreen

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#:
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;\"";
DataTable table = connection.GetSchema("DataSourceInformation");

Generates an exception:
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- (trial)

Anyone knows how to fix it?


Please Log in or Create an account to join the conversation.

9 years 2 months ago #6685 by Moderator
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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.044 seconds
Powered by Kunena Forum