【问题标题】:use embeded Firebird使用嵌入式 Firebird
【发布时间】:2012-01-29 16:15:58
【问题描述】:

我下载了 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" />

但是当我运行我的项目时出现错误。

【问题讨论】:

  • 无法访问主机上的数据库服务器错误详细信息:无法完成对主机“localhost”的网络请求
  • 您为什么使用 Firebird 1.5? Firebird 2.5.1 是最新版本

标签: c# visual-studio-2010 firebird firebird2.5


【解决方案1】:

您需要将 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

【讨论】:

    【解决方案2】:

    您的连接字符串似乎有误。我无法确定,但根据this CodeProject project 使用嵌入式 Firebird 数据库,它应该看起来更像:

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

    注意 ServerType 参数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多