本人正改用OracleClient,比oledbconnection快.NET Framework Data Provider for Oracle (System.Data.OracleClient) The .NET Framework Data Provider for Oracle is an add-on component to the .NET Framework that provides access to an Oracle database using the Oracle Call Interface (OCI) as provided by Oracle Client software. Using C#:using System.Data.OracleClient;
Dim oOracleConn As OracleConnection = New OracleConnection() oOracleConn.ConnectionString = "Data Source=Oracle8i;" & _ "Integrated Security=SSPI"; oOracleConn.Open() Note: You must have the Oracle 8i Release 3 (8.1.7) Client or later installed in order for this provider to work correctly.Note: You must have the RTM version of the .NET Framework installed in order for this provider to work correctly.Note: There are known Oracle 7.3, Oracle 8.0, and Oracle9i client and server problems in this beta release. The server-side issues should be resolved in the final release of the product. However, Oracle 7.3 client will not be supported. For more information, see: .NET Data Provider for Oracle Beta 1To view Microsoft KB articles related to OracleConnection
用OleDbConnection.
连接语句:OleDbConnection myConn=new OleDbConnection("Provider=MSDAORA;Data Source="数据库名";User ID="用户名";Password="用户密码"")
用OleDbConnection不行
我不知是缺少那个驱动,还是咋的
前天还行的
#Const gConType = "MSDataShape"#If gDataBaseSelect = "Oracle" Then#If gConType = "ODBC" Then
public Const pStrCon = "Driver={Microsoft ODBC for Oracle};" _
& " Server = " & gServer & "; User Id = " & gDataConUid _
& "; Password = " & gataConPwd & ";"
#ElseIf gConType = "OLEDB" Then
Public adoCon As OleDbConnection
Public Const pStrCon = "Provider=OraOLEDB.Oracle; " _
& " Data Source = " & gDataBase & "; User Id = " & gDataConUid _
& "; Password = " & gataConPwd & ";"
#ElseIf gConType = "OracleConnection" Then
Public Const pStrCon = "Data Source=Oracle8i;Integrated Security=yes"
#ElseIf gConType = "MSDataShape" Then
Public Const pStrCon = "Provider=MSDataShape.1;Persist Security Info=False;" _
& "Data Provider=MSDAORA; " & " Data Source = " & gDataBase _
& "; User Id = " & gDataConUid & "; Password = " & gataConPwd & ";"
#Else
#End If
我以前用的是ORACLE9.2就不行.
我把系统重做后用ORACLE9.01就没问题了.
string strConnect1 = "User Id=stat;Password=***;Data Source = webser;";
string strSql = "select passwd,groupid,county_id,user_name from userinfo where user_id='" + TextboxGongHao.Text + "'";
OracleConnection objConnect1 = new OracleConnection(strConnect1);
OracleCommand objCommand1 = new OracleCommand(strSql,objConnect1);
啥是odp.net?
“/Dispatch”应用程序中的服务器错误。
--------------------------------------------------------------------------------无法加载 DLL (oci.dll)。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.DllNotFoundException: 无法加载 DLL (oci.dll)。源错误: 执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 堆栈跟踪:
[DllNotFoundException: 无法加载 DLL (oci.dll)。]
System.Data.OracleClient.DBObjectPool.GetObject(Boolean& isInTransaction) +467
System.Data.OracleClient.OracleConnectionPoolManager.GetPooledConnection(String encryptedConnectionString, OracleConnectionString options, Boolean& isInTransaction) +165
System.Data.OracleClient.OracleConnection.OpenInternal(OracleConnectionString parsedConnectionString, Object transact) +836
System.Data.OracleClient.OracleConnection.Open() +32
Public adoCon As OleDbConnection
Public Const pStrCon = "Provider=MSDAORA.1; " _
& " Data Source = " & gDataBase & "; User Id = " & gDataConUid _
& "; Password = " & gataConPwd & ";"
再重装Oracle
还是出错...
跳楼....................
http://www.csdn.net/Develop/read_article.asp?id=16437
The .NET Framework Data Provider for Oracle is an add-on component to the .NET Framework that provides access to an Oracle database using the Oracle Call Interface (OCI) as provided by Oracle Client software. Using C#:using System.Data.OracleClient;
OracleConnection oOracleConn = new OracleConnection();
oOracleConn.ConnectionString = "Data Source=Oracle8i;" +
"Integrated Security=SSPI";
oOracleConn.Open();
Using VB.NET:Imports System.Data.OracleClient
Dim oOracleConn As OracleConnection = New OracleConnection()
oOracleConn.ConnectionString = "Data Source=Oracle8i;" & _
"Integrated Security=SSPI";
oOracleConn.Open()
Note: You must have the Oracle 8i Release 3 (8.1.7) Client or later installed in order for this provider to work correctly.Note: You must have the RTM version of the .NET Framework installed in order for this provider to work correctly.Note: There are known Oracle 7.3, Oracle 8.0, and Oracle9i client and server problems in this beta release. The server-side issues should be resolved in the final release of the product. However, Oracle 7.3 client will not be supported.
For more information, see: .NET Data Provider for Oracle Beta 1To view Microsoft KB articles related to OracleConnection