[Mono-list] Problem open connection npgsql on mono 2.10 (Windows)

Khairuddin Ni'am niam.nfinity at gmail.com
Thu Jun 23 21:04:23 EDT 2011

I'm using mono framework on *Windows*.
I'd created simple console program (targeting .NET 4) to test connection :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Npgsql;
using System.Data.SqlClient;

namespace postgretest {
	class Program {
		static void Main(string[] args)
			string connString = "Server=;Database=unitydb;User
			NpgsqlConnection conn = new NpgsqlConnection(connString);
			if (conn.State == System.Data.ConnectionState.Open)
				Console.WriteLine("Success open postgreSQL connection.");


			Console.WriteLine("end program.");

The program run fine on Mono version 2.8 build 9. But, it throw exception on
Mono version 2.10.2 build 5.

This is the exception message :

Unhandled Exception: Npgsql.NpgsqlException:
Failed to establish a connection to ''.
  at Npgsql.NpgsqlClosedState.Open (Npgsql.NpgsqlConnector context)
[0x00000] in <filename unknown>:0
  at Npgsql.NpgsqlConnector.Open () [0x00000] in <filename unknown>:0
  at Npgsql.NpgsqlConnectorPool.GetPooledConnector (Npgsql.NpgsqlConnection
Connection) [0x00000] in <filename unknown>:0

Any idea what caused this and how to fix it ?

View this message in context: http://mono.1490590.n4.nabble.com/Problem-open-connection-npgsql-on-mono-2-10-Windows-tp3621423p3621423.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list