Tuesday, June 16, 2009

Using PostgreSQL from Microsoft.NET

Introduction

PostgreSQL is one of the most important relational database systems in the open source world. It is released under a BSD style license. I've seen a few documents talking about the development of .NET application with PostgreSQL as the back-end server. That's why I'm writing this article to illustrate how you can access to the PostgreSQL database system using C#.

Getting started with the solution

For this solution, we're going to use the PostgreSQL database system which can be downloaded from http://www.postgresql.org/. You can also find a good documentation in this site. For the creation of the database and its underlying schema, we're going to use pgAdmin III. In order to access to the PostgreSQL database system from Microsoft.NET, we're going to use NpgSQL2 driver for ADO.NET which can be downloaded from http://npgsql.projects.postgresql.org/. When you unzip the npgsql archive, you can find the driver in the Npgsql.dll library inside the bin directory.

Now let's open the pgAdmin III management console and create a connection to the PostgreSQL database system (see Figure 1).

See full detail: http://www.c-sharpcorner.com/UploadFile/john_charles/UsingPostgreSQLfromMicrosoftNET06042009145024PM/UsingPostgreSQLfromMicrosoftNET.aspx

No comments: