在服务器端安装客户端的oracle

解决方案 »

  1.   

    要想用服务端的ORACLE数据库,必需在本地装ORACLE的客户端.
    用OleDbConnection.
    连接语句:OleDbConnection myConn=new OleDbConnection("Provider=MSDAORA;Data Source="数据库名";User ID="用户名";Password="用户密码"")
      

  2.   

    我装了客户端.(如果客户端都没装,我还来编程?)
    用OleDbConnection不行
    我不知是缺少那个驱动,还是咋的
    前天还行的
      

  3.   

    你用OleDbConnection时它提示的什么错误?
      

  4.   

    #Const gDataBaseSelect = "Oracle"
    #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
      

  5.   

    你用的是9.2吧.
    我以前用的是ORACLE9.2就不行.
    我把系统重做后用ORACLE9.01就没问题了.
      

  6.   

    装好oracle9i客户端和odp.net就可以用了
    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);
      

  7.   

    loveprograming() 老大:
       啥是odp.net?
      

  8.   

    还是出错:
    “/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 
      

  9.   

    try#ElseIf gConType = "OLEDB" Then
        Public adoCon As OleDbConnection
        Public Const pStrCon = "Provider=MSDAORA.1; " _
        & " Data Source = " & gDataBase & "; User Id = " & gDataConUid _
        & "; Password = " & gataConPwd & ";"
      

  10.   

    我就是在那个操作系统装个.net
    再重装Oracle
    还是出错...
    跳楼....................
      

  11.   

    .NET中各种数据库连接大全  
    http://www.csdn.net/Develop/read_article.asp?id=16437
      

  12.   

    先试试别的连接方法,比如ODBC
      

  13.   

    我想请问一下用OracleConnection连也得装oracle的客户端吗?那比OleDbConnection连接有什么好处? 有没有不装客户端的方法?
      

  14.   

    本人正改用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;
     
    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