This .NET Framework Class Library is provided by Npgsql Development Team. The main functionality of the class library is contained in the file Npgsql.dll.

Add a reference to the assembly Npgsql and include the Npgsql namespace. Instantiate a new NpgsqlConnection connection object. Set the connection string and open the connection.

VB.NET code sample
Imports Npgsql
Dim myConnection As NpgsqlConnection = New NpgsqlConnection()
myConnection.ConnectionString = myConnectionString
' execute queries, etc
C# code sample
using Npgsql;
NpgsqlConnection myConnection = new NpgsqlConnection();
myConnection.ConnectionString = myConnectionString;
// execute queries, etc


Npgsql is a .Net Data Provider for Postgresql. It allows any program developed for .Net framework to access database server. It is implemented in 100% C# code. Works with Postgresql 7.x and above.

More info about this class library can be found at the Npgsql Development Team product page.


This .NET Framework Class Library, Npgsql, can be downloaded here.

Connection Strings

The Npgsql class library can be used to connect to the following data sources by using the following connection string references: