Search This Blog

Tuesday, October 21, 2014

Instant Oracle Using C# / asp.net

I  developed  a WS site , via oracle client 12 , when i tried to deploy it on server i find out  that there is an oracle client 11 install there, i found the way to use oracle 12 in my web site , and managed to grab the right dll to make it work.



its all started when i get the next error on server, i undertood that i am running with different oracle version:

Could not load file or assembly 'Oracle.DataAccess, Version=4.121.1.0 Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.


i looked in my machine.config and i found out that i am using oracle data access  Version=4.112.3.0 - an older verion.


i download the oracle instant client  (based on the version i wanted )  instantclient-basic-nt-12.1.0.2.0.zip.

i copied the next dlls into my bin folder :



oci.dll

oraocci12.dll

oraociei12.dll

oraons.dll

OraOps12.dll


and also the Oracle.DataAccess.dll from my dev machine.

the connection string must look like this :



connectionString="Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = Yaniv-il-db.domain.int)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = Yanivil)));User Id=MyUSer;Password=Mypwd;" providerName="Oracle.DataAccess.Client"



and its worked

enjoy

Yaniv Tzanany

No comments: