I use firebird database. and C# connection use Oledb. My service running my localhost but change connection string localhost to Ip adress dont connection an error. Error description is DB_E_ERRORSOCCURRED(0x80040E21)
Web.Config Code
<?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# Code
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";
I use debug error point sorgu.
Finally i'm running :) change connection string and running.
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
Seem, your original connection string contains the mistake:
"User Instance=True >>>;<<<< ctype=WIN1254"
:)
User contributions licensed under CC BY-SA 3.0