Subject: Has anyone learned how to connect to Postgres SQL?
Posted By: David_0223 Post Date: 4/18/2008 8:37:21 AM
I see this question posted back in 2004 with no responses.  It's funny how Microsoft doesn't recognize any other software.  On to the question.  I have gotten this far:


...
OleDbConnection conn;
...
OleDbConnectionStringBuilder conStr = new OleDbConnectionStringBuilder();

conStr.DataSource = "localhost";
conStr.Provider = "PostgreSQL.1";
conStr["User ID"] = "<SomeUsername>";
conStr["Password"] = "<SomePassword>";
...
conn = new OleDbConnection(conStr.ConnectionString);
...
conn.Open();


This will connect me to the database engine.  But doesn't get me to the database I'm using so queries fail.  If I try ... From MyDatabase.MyTable ... I get a schema not found error.

Is there anyone out there who realizes that Microsoft isn't the only software company?


What you don't know can hurt you!
Reply By: dparsons Reply Date: 4/18/2008 9:09:40 AM
Have you tried using the .NET provider for Postgre?

http://pgfoundry.org/projects/npgsql/

===========================================================
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
===========================================================
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
===========================================================
Reply By: David_0223 Reply Date: 4/18/2008 11:15:44 PM
Thanks, that did the trick.  The instructions on the site were excellent.  Had to hunt around for mono.security.dll, but found in the source download.

thanks again.

What you don't know can hurt you!

Go to topic 70286

Return to index page 1