我使用firebird数据库。和C#连接使用Oledb。我的服务运行我的本地主机,但改变连接字符串本地主机IP地址不连接错误。错误说明是DB_E_ERRORSOCCURRED(0x80040E21)火鸟连接DB_E_ERRORSOCCURRED(0x80040E21)
的Web.Config代码
<?xml version="1.0"?>
<configuration>
<appSettings/>
<system.web>
<compilation debug="true" targetFramework="4.5"/>
<authentication mode="Windows"/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<connectionStrings>
<add name="baglantiCumlesi"
connectionString="Provider=LCPI.IBProvider.3;Data Source=DEDEDE; Location=E:\Publish\Data\B2C.FDB; Integrated Security=True; User Instance=True ctype=WIN1254; Persist Security Info=True; auto_commit=True; auto_commit_level=4096;dbclient_library=fbclient.dll; dbclient_type=fb2.0; Trusted_Connection=yes; connection reset=false; connection lifetime=0; enlist=true; min pool size=1; max pool size=100; User ID=SYSDBA; Password=masterkey;"
providerName="System.Data.OleDb"
/>
</connectionStrings>
</configuration>
C#代码
string baglantiCumlesi = ConfigurationManager.ConnectionStrings["baglantiCumlesi"].ConnectionString;
OleDbConnection baglanti = new OleDbConnection(baglantiCumlesi);
baglanti.Open();
string sorgu = "SELECT P.ADISOYADI, UNVANI, T.DAHILI ,'<a href=mailto:'||EMAIL||'>'||EMAIL||'</a>' AS EMAIL"+
" FROM PERSONEL P"+
" LEFT JOIN TELELINK L ON L.INTERNAL = P.PERSONEL_NO"+
" AND L.SINTERNAL = 'PERS' AND L.VARSAYILAN = 'E'"+
" LEFT JOIN TELEFONL T ON T.TELEFON_NO = L.TELEFON_NO"+
" WHERE WEB_AKTIF = 'E' AND PERSONEL_NO > 0 AND BLOKE = 'H'"+
" ORDER BY PERSONEL_KODU";
我使用调试错误点sorgu。
http://i61.tinypic.com/2lapopv.png
** oledberr.h **我看到这个文本的错误** DB_E_ERRORSOCCURRED **:多步OLE DB操作产生的错误。检查每个OLE DB状态值(如果可用)。没有工作完成。 – magicandre1981 2014-10-31 16:00:01
thx评论,但运行本地主机我不明白这个错误。更改位置到本地主机运行,但此状态未运行 – metin 2014-11-01 07:15:56
为什么您使用OleDB?你为什么不使用Firebird .Net Provider? – magicandre1981 2014-11-01 07:20:19