[Mono-list] Firebird .NET Data Provider: System.ArgumentException: Encoding name 'ks_c_5601-1987' not supported

Bernhard Fischer email at bernhard-fischer.de
Sat Feb 9 19:28:02 EST 2008


Windows XP SP2, Firebird .NET data provider 2.1.0, Firebird Server 
2.0.3, Mono 1.2.6

When I run a most simple console application on Windows to connect to a 
database, everythings works fine. When I run the same application in a 
Mono box, there is an exception. I tried different character sets 
without success. I even downloaded the source code and compiled the data 
provider with ShardDevelop (Mono target), but this did not help either. 
How can I use  the Firebid .NET data provider in Mono ?


the code:


using System;
using System.Collections.Generic;
using System.Text;

using FirebirdSql.Data.FirebirdClient;

namespace ConsoleApplication2
{
   class Program
   {
       static void Main(string[] args)
       {
           FbConnection con = new 
FbConnection("Server=localhost;Database=C:\\mydatabase.fdb;UserID=SYSDBA;Password=secret;Charset=UTF8"); 

           con.Open();
           con.Close();
       }
   }
}


the exception:

Unhandled Exception: System.TypeInitializationException: An exception 
was thrown
by the type initializer for FirebirdSql.Data.Common.Charset ---> 
System.Argumen
tException: Encoding name 'ks_c_5601-1987' not supported
Parameter name: name
 at System.Text.Encoding.GetEncoding (System.String name) [0x00000]
 at FirebirdSql.Data.Common.Charset.GetEncoding () [0x00000]
 at FirebirdSql.Data.Common.Charset..ctor (Int32 id, System.String name, 
Int32
bytesPerCharacter, System.String systemName) [0x00000]
 at FirebirdSql.Data.Common.Charset.Add 
(System.Collections.Generic.List`1 char
sets, Int32 id, System.String charset, Int32 bytesPerCharacter, 
System.String sy
stemName) [0x00000]
 at FirebirdSql.Data.Common.Charset.InitializeSupportedCharsets () 
[0x00000]
 at FirebirdSql.Data.Common.Charset..cctor () [0x00000] --- End of inner 
except
ion stack trace ---

 at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect () 
[0x00000]
 at (wrapper remoting-invoke-with-check) 
FirebirdSql.Data.FirebirdClient.FbConn
ectionInternal:Connect ()
 at FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create () [0x00000]
 at FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut () [0x00000]
 at (wrapper remoting-invoke-with-check) 
FirebirdSql.Data.FirebirdClient.FbConn
ectionPool:CheckOut ()
 at FirebirdSql.Data.FirebirdClient.FbConnection.Open () [0x00000]



More information about the Mono-list mailing list