<?xml version="1.0" encoding="iso-8859-1" ?>
<add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for Postgresql Server" type="Npgsql.NpgsqlFactory, Npgsql, Version=220.127.116.11, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
Thomas said that "the tags are case sensitive and the
Thank you Thomas for your feedback which, for sure will help others to get their configuration up and running. I will check with Mono guys to see why my original configuration worked.
Today I committed an initial support for provider factory to Npgsql2.
This will allow ado.net 2.0 users to work with Npgsql using ado.net generic coding.
In order to use it, you have to add the following xml config in your machine.config or yourapp.exe.config file:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for Postgresql Server" type="Npgsql.NpgsqlFactory, Npgsql, Version=18.104.22.168, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7">
P.S.: Sorry for indentation lacking. I don't know how to add it on blogger :(
Note that this is the full contents of a yourapp.exe.config file. If you are changing the machine.config file, just add the "add name=..." section.
The key elements here are the invariant name which will be used in your application when returning the provider factory. In this case it is defined as "Npgsql". But you can specify whatever you want.
That's it! If everything is ok, you will be able to write some code like that, to connect to postgresql:
public class c
public static void Main(String args)
DbProviderFactory factory = DbProviderFactories.GetFactory("Npgsql");
DbConnection conn = factory.CreateConnection();
conn.ConnectionString = "Server=127.0.0.1;User id=npgsql_tests;password=npgsql_tests;";
P.S.: Npgsql2 code is found in Npgsql2 cvs module. See here for more info about how to get it.
Warning: This is a very early code, so bugs still exist and there are things missing. Basic functionality should work ok.