使用Firebird嵌入式数据库时,如何解决C#中的连接错误? [英] How to solve connection error in c# while using firebird embeded database?

查看:276
本文介绍了使用Firebird嵌入式数据库时,如何解决C#中的连接错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个带有firebird嵌入式数据库的桌面应用程序. 我下载了FirebirdSql.Data.FirebirdClient.dll,并添加了该dll以供参考. 我将这些文件添加到输出文件夹

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

我使用此连接字符串

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

但是我遇到了这个错误,我从Google进行搜索,但是我找不到解决方案,有人在帮助我吗? 注意:我看了一下,但是没用.

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

推荐答案

连接字符串错误. ServerType应为1.

Connection string is wrong. ServerTypeshould be 1.

这篇关于使用Firebird嵌入式数据库时,如何解决C#中的连接错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆