简体   繁体   English

如何将Asp.net网站连接到联网计算机上的Oracle数据库

[英]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: 我正在使用Visual Studio 2010 nd Config.XML具有以下代码:

<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 服务器已安装Oracle 11g,并且已经安装 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). 看起来您正在使用的oracle客户端库和应用程序不匹配(32位或64位版本)。 you can either get the correct .dll or change your applications CPU setting to the version of your dll (32bit or 64bit). 您可以获取正确的.dll或将应用程序的CPU设置更改为dll的版本(32位或64位)。

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. 由于服务器托管在64位OS中,因此(win32_11gR2_client)在我的64位操作系统上安装32-bit Oracle Client (win32_11gR2_client) But the Oracle installed was a 32-bit Application. 但是安装的Oracle32位应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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