System.Data.OracleClient requires Oracle client software version 8.1.7 or higher

I installed the client version of Oracle 10g on my PC (registry ORACLE_BASE-D: \ oracle \ product \ 10.2.0). I have added below links. System.Data.OracleClient.

I get the above error. The following is a snippet of code.

public static OracleConnection getConnection() 
    {

        try 
        {
            dataSource = new SqlDataSource();
            dataSource.ConnectionString = System.Configuration.ConfigurationManager.AppSettings.Get("conn");
            OracleConnection connection = new OracleConnection();
            if (dataSource == null) 
            {
                // Error during initialization of InitialContext or Datasource
                throw new Exception("###### Fatal Exception ###### - DataSource is not initialized.Pls check the stdout/logs.");
            } 
            else
            {
                connection.ConnectionString = dataSource.ConnectionString;
                connection.Open();
            }
            return connection;            
        }catch (Exception ex) 
        {
            throw ex;
        }  

    }

Please let me know which areas of the Concern and where Iam missing. I am new to combining Oracle and Asp.Net.

+1
source share
4 answers

It looks like you are using the Microsoft oracle client. I suggest you use the ODP.net driver as it is much more reliable. (I believe the Microsoft client is also outdated?)

http://www.oracle.com/technetwork/topics/dotnet/index-085163.html

ODP.net, Oracle.DataAccess , ! ( ):

using System;
using System.Data;
using Oracle.DataAccess.Client;

static class Program
{
    [STAThread]
    static void Main()
    {
        TestOracle();
    }

    private static void TestOracle()
    {
        string connString = 
            "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)" + 
            "(HOST=servername)(PORT=‌​1521)))" +
            "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=servicename)));"+ 
            "User Id=username;Password=********;";
        using (OracleConnection conn = new OracleConnection(connString))
        {
            string sqlSelect = "SELECT * FROM TEST_TABLE";
            using (OracleDataAdapter da = new OracleDataAdapter(sqlSelect, conn))
            {
                var table = new DataTable();
                da.Fill(table);

                if (table.Rows.Count > 1) 
                    Console.WriteLine("Successfully read oracle.");
            }
        }
    }
}

EDIT: " Oracle client software version 8.1.7 ". Oracle Client . Oracle Client ( ) , Microsoft.

+2

System.Data.OracleClient oracle, .Net. :

  • Oracle Client Oracle ,
  • oraociicus10.dll( Basic-Lite) aociei10.dll( ), oci.dll, orannzsbb10.dll oraocci10.dll oracle bin , dll
+2

" Oracle 10g " "System.Data.OracleClient Oracle 8.1.7 "

Microsoft Oracle Client, System.Data.OracleClient .NET Framework 4.0 .NET. http://msdn.microsoft.com/en-us/library/77d8yct7.aspx

, Oracle (8 ) . PATH, , Oracle. "tnsping" Windows, 10, - .

Oracle oracle. oracle, Oracle Database .

, Oracle Client 11g R2 Oracle Data Providers .NET. http://www.oracle.com/technetwork/topics/dotnet/index-085163.html

.NET Framework 4.0 , Oracle.DataAccess Visual Studio Project, , dll 4.x.x.x, dll 4.x.x.x

+1

Oracle client software still needs to be installed on the client computer to allow connection to the Oracle database. SQL * Net database user, which is the Oracle connectivity level for the Oracle database. In dll System.Data.OracleClientthis function is absent.

Download Oracle Client Software

You must also provide a link to the DLL when compiling the code. For example, if you are compiling a program in C #, your command line should include:

as: - csc /r:System.Data.OracleClient.dll

MSDN

+1
source

All Articles