收录日期:2020/06/02 03:58:46 时间:2009-08-07 15:52:41 标签:postgresql,c#-3.0

How do I Connect C# with Postgres? I download the npgsql data provider but couldn't make it work. Are there more examples than the ones in the Postgres site?

Cheers,

Here is a walkthrough, Using PostgreSQL in your C# (.NET) application (An introduction):

In this article, I would like to show you the basics of using a PostgreSQL database in your .NET application. The reason why I'm doing this is the lack of PostgreSQL articles on CodeProject despite the fact that it is a very good RDBMS. I have used PostgreSQL back in the days when PHP was my main programming language, and I thought.... well, why not use it in my C# application.

Other than that you will need to give us some specific problems that you are having so that we can help diagnose the problem.

You want the NPGSQL library. Your only other alternative is ODBC.

If you want an recent copy of npgsql, then go here

http://www.npgsql.org/

This can be installed via package manager console as

PM> Install-Package Npgsql