.net 访问Oracle的连接字符串(转)

 方法一:通过System.Data.OracleClient(需要安装Oracle客户端并配置tnsnames.ora) 这个大家都知道,就不细说了

oracleConnectionString : data source = orcl;user id= scott; password=tiger;persist security info=false;


方法二,是利用OldeDb 来连接

oracleConnectionString :

    Provider=OraOLEDB.Oracle.1;User ID=scott;Password=tiger;Data Source=(DESCRIPTION = (ADDRESS_LIST= (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.125.250)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = orcl)))

貌似MSDN上OledbCommandType 没有可以对应Oracle 的 ref Cursor ,所以就抛弃了他,


方法三:需要oracle客户端,但是不需要配置tnsnames.ora

连接字符串 oracleConnectionString

User ID=scott;Password=tiger;Data Source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST=10.10.125.250)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=orcl)))

你可能感兴趣的:(.net 访问Oracle的连接字符串(转))