[Mono-list] Npgsql1.0 Protocol option not supported

Andrus kobruleht2 at hot.ee
Sat Jan 13 11:26:43 EST 2007


My C# application returns error

Protocol option not supported

Error occurs in line

Connection.Open();

Npgsql1.0 source code and docs does not contain such message.
When running under .NET 2 this error does not occur.

Any idea how to fix it ?

Environment:

Npgsql1.0
MONO 1.2  .net 2 profile
monocharge-20070112
Windows XP
VCS 2005 Express

Code where error occurs is:

public static void CreateConnection(string Server, string Database,
       string User, string Password) {

NpgsqlEventLog.Level = LogLevel.Debug;
NpgsqlEventLog.LogName = @"c:\NpgsqlLogFile.txt";

if (Connection != null)
    Connection.Close();

ConnectionString = "ENCODING=UNICODE;" +
       "SERVER=" + Server + ";" +
       "DATABASE=" + Database + ";" +
       "USER ID=" + User + ";" +
       "PASSWORD=" + Password + ";";

Connection = new NpgsqlConnection(ConnectionString);
IDbCommand Command = new NpgsqlCommand(@"
        SET search_path TO firma1,public;
        SELECT sfirmanimi FROM prpalk",
     (NpgsqlConnection)Connection);
// Follwing line causes error Protocol Option not supported in MONO
Connection.Open();
}

Stack trace:

Protocol option not supportedStack trace:   at Npgsql.NpgsqlClosedState.Open
(Npgsql.NpgsqlConnector context) [0x00000]
  at Npgsql.NpgsqlConnector.Open () [0x00000]
  at Npgsql.NpgsqlConnectorPool.GetPooledConnector (Npgsql.NpgsqlConnection
Connection) [0x00000]


npgsql Log file:

13.01.2007 18:12:45 2364 Debug Entering
NpgsqlConnection.NpgsqlConnection(NpgsqlConnection())
13.01.2007 18:12:45 2364 Debug ConnectionString Option: ENCODING = UNICODE
13.01.2007 18:12:45 2364 Debug ConnectionString Option: SERVER = localhost
13.01.2007 18:12:45 2364 Debug ConnectionString Option: DATABASE = mydb
13.01.2007 18:12:45 2364 Debug ConnectionString Option: USER ID = admin
13.01.2007 18:12:45 2364 Debug ConnectionString Option: PASSWORD = p
13.01.2007 18:12:45 2364 Debug Entering NpgsqlCommand.NpgsqlCommand()
13.01.2007 18:12:45 2364 Debug Entering
NpgsqlParameterCollection.NpgsqlParameterCollection()
13.01.2007 18:12:45 2364 Debug Set NpgsqlCommand.Transaction =
13.01.2007 18:12:45 2364 Debug Entering NpgsqlConnection.Open()
13.01.2007 18:12:46 2364 Debug Get NpgsqlClosedState.Instance
13.01.2007 18:12:46 2364 Debug Get NpgsqlClosedState.Instance
13.01.2007 18:12:46 2364 Debug Entering NpgsqlClosedState.Open()
13.01.2007 18:12:46 2364 Debug Get NpgsqlClosedState.Instance

Andrus.



More information about the Mono-list mailing list