c#.net连接远程oracle数据库的连接字符串

时间:2021-12-24 07:58:13

c#.net连接远程oracle数据库的连接字符串


Oracle  ODBC


 New version:

"Driver={Microsoft ODBC for Oracle};Server=OracleServer.world;Uid=Username;Pwd=asdasd;"

 

 Old version:

"Driver={Microsoft ODBC Driver for Oracle};ConnectString=OracleServer.world;Uid=myUsername;Pwd=myPassword;"

 

 OLE DB, OleDbConnection (.NET)


 Standard security:

"Provider=msdaora;Data Source= MyOracleDB;UserId=UserName;Password=asdasd;"
This one's from Microsoft, the following are from Oracle
 Standard Security:

"Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=Username;Password=asdasd;"

 

 Trusted Connection:

"Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;OSAuthent=1;"

 

 OracleConnection (.NET)


 Standard:

"Data Source=Oracle8i;Integrated Security=yes";
This one works only with Oracle 8i release 3 or later
 Declare the OracleConnection:

C#:
using System.Data.OracleClient;
OracleConnection oOracleConn = new OracleConnection();
oOracleConn.ConnectionString = "my connectionstring";
oOracleConn.Open();

参考资料:http://www.cnblogs.com/daview/archive/2004/04/10/5763.aspx