- Thank you received: 0
Exception when get DataSourceInformation from ADO.NET
- rtgreen
- Topic Author
- Visitor
-
10 years 8 months ago #6683
by rtgreen
Exception when get DataSourceInformation from ADO.NET was created by rtgreen
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#:
Generates an exception:
Provider PGNP-Postgres-SE-Trial-1.4.0.3076.exe (trial)
Anyone knows how to fix it?
Thanks.
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:
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:
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.
Please Log in or Create an account to join the conversation.
- Moderator
-
- Offline
- New Member
Less
More
10 years 8 months ago #6685
by Moderator
Replied by Moderator on topic Re: Exception when get DataSourceInformation from ADO.NET
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.156 seconds