2014-10-31 200 views
0

我使用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

+0

** oledberr.h **我看到這個文本的錯誤** DB_E_ERRORSOCCURRED **:多步OLE DB操作產生的錯誤。檢查每個OLE DB狀態值(如果可用)。沒有工作完成。 – magicandre1981 2014-10-31 16:00:01

+0

thx評論,但運行本地主機我不明白這個錯誤。更改位置到本地主機運行,但此狀態未運行 – metin 2014-11-01 07:15:56

+1

爲什麼您使用OleDB?你爲什麼不使用Firebird .Net Provider? – magicandre1981 2014-11-01 07:20:19

回答

1

最後我跑:)變化的連接字符串和運行。

Provider=LCPI.IBProvider.3; Data Source=DEDEDE; 
       Location=DEDEDE:E:\Publish\Data\B2C.FDB;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 
0

看起來,你原來的連接字符串包含的錯誤:

「用戶實例=真>>>; < < < < CTYPE = WIN1254」

:)

+0

omg :)我沒看見:) – metin 2014-11-06 12:44:50