使用OracleConnection连接Oracle数据库的问题
我使用OracleConnection连接Oralce数据库,连接字符串是
Provider=MSDAOORA.1;Password = ***;User ID = ***; Data Source = ***;Persist Security Info = true;
为什么创建连接的时候,他就说不支持关键字Provider,
换成别的连接字符串也是一样报这个错误.
而我这些字符串在ASP或是Delphi环境下都能成功连接Oracle数据库的, 请高手帮帮我.谢谢
[解决办法]
OracleConnection (.NET)
Standard:
"Data Source=MyOracleDB;Integrated Security=yes; "
This one works only with Oracle 8i release 3 or later
Specifying username and password:
"Data Source=MyOracleDB;User Id=myUsername;Password=passwd;Integrated Security=no; "
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 connection string ";
oOracleConn.Open();
VB.NET:
Imports System.Data.OracleClient
Dim oOracleConn As OracleConnection = New OracleConnection()
oOracleConn.ConnectionString = "my connection string "
oOracleConn.Open()
Missing the System.Data.OracleClient namespace? Download .NET Managed Provider for Oracle > >
Great article! "Features of Oracle Data Provider for .NET " by Rama Mohan G. at C# Corner