【问题标题】:How to connect a Asp.net website to Oracle Database on a Networked Computer如何将 Asp.net 网站连接到联网计算机上的 Oracle 数据库
【发布时间】:2014-11-13 07:01:07
【问题描述】:

我正在使用 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;"/>

在运行应用程序时遇到以下错误:

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)

服务器已安装 Oracle 11g,我已在客户端计算机上安装 win64_11gR2_client

【问题讨论】:

    标签: c# asp.net database oracle networking


    【解决方案1】:

    看起来您正在使用的 oracle 客户端库和应用程序不匹配(32 位或 64 位版本)。您可以获取正确的 .dll 或将您的应用程序 CPU 设置更改为您的 dll 版本(32 位或 64 位)。

    【讨论】:

    • 我有 64 位 Windows 8.1,服务器也有 Windows 8 64 位,但服务器上安装的 oracle 是 32 位软件。我已经安装了 64 位客户端。
    • 我能够将 OracleSQLDevoloper 连接到 Oracle 服务器。
    【解决方案2】:

    我终于找到了解决办法。

    必须在我的 64 位操作系统上安装 32-bit Oracle Client (win32_11gR2_client),因为服务器托管在 64 位操作系统中。但是安装的 Oracle32 位应用程序。

    【讨论】:

      猜你喜欢
      • 2013-07-12
      • 1970-01-01
      • 2018-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多