views:

394

answers:

4

Am trying to run a C# application which fetches data from PostgreSQL database(8.4) and am using the PostgreSQL OLE DB Provider

This is my connection string

string connString = @"Provider=PostgreSQL OLE DB Provider;Data Source=localhost;location=;User ID=;password=;timeout=1000";

The error am getting is

The 'PostgreSQL OLE DB Provider' provider is not registered on the local machine

Can anyone point out me where should I correct so as to get the connect to the database. By the way am using PGOLEDBLib.

A: 

Try using "PostgreSQL" or "PostgreSQL.1" for the Provider attribute.. If that does not work, you will probably need to re-install the driver.

RedFilter
+1  A: 

Any particular reason you're using the OLE DB provider? I believe the general idea is that you get better performance, and I think also functionality, if you use a native .net provider - e.g. http://npgsql.projects.postgresql.org/

Magnus Hagander
I have used Npgsql and am aware of its functionality. I wanted to use the other providers, no particular reason to use the OLE DB provider. But from what I've read using OLE DB providers is a better option.
Chaitanya
Fair enough. There are AFAIK multiple OLEDB adapters available for PostgreSQL though - make sure you don't pick the one that's basically stopped being developed. It may be that only proprietary options are available at this point - I'm not entirely sure. But the "pgoledb" one appears to be unmaintaned at this time.
Magnus Hagander
Can you post the article here where you have read it please.
Tomi
A: 

OpenLink Software have a Postgres ADO.Net Provider for .Net 1.x & 2.x and for .Net 3.5 Entity Frameworks, which can be download on evaluation using the links provided.

hwilliams
A: 

I have seen a few different "pgoledb" libraries. None appear to actually be named "pgoledblib", so this info may or may not apply to you.

The most recently active PGOLEDB has documented their connection string attributes here; it appears they use a different Provider value -- "PGNP.1".

Another provider, which seems to have been languishing since 2006, has connection strings here; these are in line with the earlier suggestions from OrbMan.

Of course, you may find that paying nothing for such a provider leads to paying much in installation, configuration, and utilization headaches. Towards easing such headaches, I offer a link to my employer's options supporting ODBC, JDBC, and ADO.NET clients on many platforms.

TallTed