0

我一直在尝试使用以下连接字符串连接到 Oracle 服务器:

            OracleConnection conn = new OracleConnection();
            conn.ConnectionString = @"Data Source=
(DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.206.0.23)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = ORCLWEX3)
    )
 )
;User Id= RAMNIVAS_CI;Password= RAMNIVAS_CI;Persist Security Info=True;";
            conn.Open();

但得到以下错误:

System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.

虽然我已经安装了。

我已经能够使用 Oracle Sql Developer 连接到该服务器。设置是:
Oracle SQL 开发人员设置 TNSNAMES 文件是这样的:

# tnsnames.ora Network Configuration File: F:\app1\product\11.1.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORCLWEX1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oracle-db.newvisionsoftware.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = ORCLWEX1)
    )
  )

ORCLWEX2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oracle-db2.newvisionsoftware.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = ORCLWEX2)
    )
  )

ORCLWEX3 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.206.0.23)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = ORCLWEX3)
    )
  )

我被告知要使用最后一个:ORACLEWEX3。
我知道连接字符串中存在一些问题,如果有人可以帮助我,我将不胜感激。

4

1 回答 1

0

如果您使用用户名/密码,我认为您不需要使用“持久安全信息”。查看: http ://connectionstrings.com/oracle 以获取更多示例。

此外,您可以尝试使用 Oracle 自己的 .net 提供程序: http ://www.oracle.com/technetwork/topics/dotnet/index-085163.html 看看这是否更适合您。

于 2012-08-16T05:48:50.383 回答