How to solve connection error in c# while using firebird embeded database?

[亡魂溺海] 提交于 2019-12-12 03:51:00

问题


I develope a desktop application with firebird embeded database. I download FirebirdSql.Data.FirebirdClient.dll.I add this dll to reference. I add these file to output folder

aliases.conf
fbembed.dll
firebird.conf
firebird.msg
ib_util.dll
icudt30.dll
icuin30.dll
icuuc30.dll

And I use this connection string

 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());
                }

But i got this error and i search from google but i cannot find solution is there anyone help me? Note: I look at this but it didn't work.

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()

回答1:


Connection string is wrong. ServerTypeshould be 1.



来源:https://stackoverflow.com/questions/15537332/how-to-solve-connection-error-in-c-sharp-while-using-firebird-embeded-database

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!