简体   繁体   中英

How to connect a Asp.net website to Oracle Database on a Networked Computer

I am using Visual Studio 2010 nd Config.XML has the following code:

<connectionstring ModuleId="2" Type="ORA" ConntecionString="Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.129.11.232)(PORT = 1521)))(CONNECT_DATA =(SID=ORCL)(SERVER = dedicated)));User ID=utcfms_db26Aug14;Password=utcfms_db26Aug14;"/>

On Running the application following errors are encountered:

System.InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException.  This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

Server has Oracle 11g Installed and I have installed win64_11gR2_client on Client Machine.

It looks like the oracle client library you are using and the application is a mismatched (32bit or 64bit version). you can either get the correct .dll or change your applications CPU setting to the version of your dll (32bit or 64bit).

I finally found the solution.

Had to install 32-bit Oracle Client (win32_11gR2_client) on my 64-bit Operating System as the server was hosted in a 64-Bit OS. But the Oracle installed was a 32-bit Application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM