简体   繁体   English

无法使用ADO.Net连接到远程Oracle服务器| 连接字符串错误?

[英]Can't connect to remote Oracle server using ADO.Net | Connection string error?

I have been trying to connect to an Oracle server using the following connection string: 我一直在尝试使用以下连接字符串连接到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();

But getting the following error: 但是出现以下错误:

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

Although I have already installed it. 虽然我已经安装了它。

I have been able to connect to that server using Oracle Sql Developer. 我已经能够使用Oracle Sql Developer连接到该服务器。 The settings are : 设置为:
Oracle SQL Developer设置 The TNSNAMES files is like this: 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)
    )
  )

I have been told to use the last one: ORACLEWEX3. 我被告知要使用最后一个:ORACLEWEX3。
I know there is some problem in the connection string and would be grateful if someone could help me. 我知道连接字符串中存在一些问题,如果有人可以帮助我,将不胜感激。

I don't think you need to use 'Persist Security info' if you're using username/password. 如果您使用用户名/密码,我认为您不需要使用“持久性安全信息”。 Take a look at: http://connectionstrings.com/oracle for more examples. 看一下: http : //connectionstrings.com/oracle以获取更多示例。

Additionally, you could try using Oracle's own .net provider: http://www.oracle.com/technetwork/topics/dotnet/index-085163.html see if that works better for you. 此外,您可以尝试使用Oracle自己的.net提供程序: http : //www.oracle.com/technetwork/topics/dotnet/index-085163.html看看是否对您更好。

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

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