我使用firebird嵌入式數據庫開發了一個桌面應用程序。 我下載了FirebirdSql.Data.FirebirdClient.dll.I添加此dll以供參考。 我這些文件添加到輸出文件夾如何在使用firebird嵌入式數據庫時解決c#中的連接錯誤?
aliases.conf
fbembed.dll
firebird.conf
firebird.msg
ib_util.dll
icudt30.dll
icuin30.dll
icuuc30.dll
而且我用這個連接字符串
String connectionString="ServerType=0;User=SYSDBA;Password=masterkey;Dialect=3;Database=mydb.fdb";
FbConnection con = new FbConnection(connectionString);
try
{
con.Open();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
但我得到這個錯誤,我從谷歌搜索,但我無法找到解決方案有誰能幫助我? 注:我看着這個,但它沒有奏效。
http://stackoverflow.com/questions/4014097/how-to-connect-and-use-firebird-db-embedded-server-with-visual-c-sharp-2010?answertab=votes#tab-top
FirebirdSql.Data.FirebirdClient.FbException (0x80004005): Unable to complete network request to host "localhost". ---> Unable to complete network request to host "localhost".
FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create()
FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut()
FirebirdSql.Data.FirebirdClient.FbConnection.Open()
它看起來像您的應用程序忽略了嵌入式部分並通過網絡執行標準連接請求。你確定'fbembed.dll'正在通過你的程序加載嗎?某些數據庫訪問層需要將'fbembed.dll'重命名爲前Firebird客戶端('fbclient.dll')才能工作,但我不知道.NET客戶端,所以我不確定這一點。 – jachguate 2013-03-21 00:41:56
感謝您的回覆。我將fbemded.dll重命名爲fbclient.dll,發生了另一個錯誤。 – mikel 2013-03-21 06:36:43