0

我下载了 Firebird-1.5.6.5026-0_embed_win32.zip 并在我的程序附近复制文件 fbembed.dll 和 firebird.msg 和 ib_util.dll。我使用这个连接字符串:

<add name="Connection" connectionString="server type=Embedded;user=SYSDBA;password=masterkey;database=E:\TEST.FDB;dialect=3;charset=NONE;connection lifetime=15;pooling=true;minpoolsize=0;maxpoolsize=50;packet size=8192;servertype=0;clientlibrary=fbembed.dll" providerName="FirebirdSql.Data.FirebirdClient" />

但是当我运行我的项目时,我得到了错误。

4

2 回答 2

0

看起来你的连接字符串是错误的。我无法确定,但根据这个 CodeProject 项目使用 Firebird 数据库作为嵌入式它应该看起来更像:

"ServerType=1;User=SYSDBA;Password=masterkey;Dialect=3;Database=mydb.fdb"

注意 ServerType 参数。

于 2012-01-29T16:28:04.023 回答
0

您需要将 firebird.msg、firebird.conf、icudt30.dll、icuin30.dll、icuuc30.dll 和 ib_util.dll 添加到您的项目文件和输出文件夹中。

重要通知:切勿使用紧凑的 .Net 数据提供程序。因为他们只为普通和超级火鸟服务器制作了它。它不适用于嵌入式服务器。

试试看:

FbConnection con = new FbConnection("User=SYSDBA;" + "Password=masterkey;" + "Database=TEST.FDB;" + "DataSource=127.0.0.1;" + "Port=3050;" + "Dialect=3;" + "Charset=UTF8;");
try  {
         con.Open();
     }
catch (Exception ex) 
     {
        MessageBox.Show(ex.ToString());
     }

这是我的原始答案和原始问题: How to connect and use Firebird db Embedded server with Visual C# 2010

于 2012-01-29T18:22:36.300 回答