locked
Oracle 10g connection RRS feed

  • Question

  • User-46330738 posted

    Hi

    I am very new for oracle connection. I have oracle 10g and i am using C# code to connect with oracle using the ADO.net. But i am unable to connect with oracle. I am getting some error. The ERROR is : " System.Data.OracleClient requires Oracle client software version 8.1.7 or greater."

    see this is my code:

    I added the reference.

    using System.data.OracleClient;


       string connectionString = "Data Source=192.168.0.91; User id=sys; Password=oracle123;";
                string queryString = "SELECT CUSTOMER_ID, NAME FROM scott.emp";
                
                using (OracleConnection connection = new OracleConnection(connectionString))
                {
                    OracleCommand command = connection.CreateCommand();
                    command.CommandText = queryString;

                    try
                    {
                        connection.Open();

                        OracleDataReader reader = command.ExecuteReader();

                        while (reader.Read())
                        {
                            Console.WriteLine("\t{0}\t{1}",
                                reader[0], reader[1]);
                        }
                        reader.Close();
                    }
                    catch (Exception ex)  // Here the error is : " System.Data.OracleClient requires Oracle client software version 8.1.7 or greater."
                    {
                        Console.WriteLine(ex.Message);
                    }

    Please tell me the solution.

    Wednesday, September 14, 2011 9:01 AM

Answers

  • User269602965 posted

    If Oracle 10g is on another computer in the LAN, then install the Oracle ODP.NET 11gR2 on the application computer but select the Client installation when prompted.

    http://www.oracle.com/technetwork/database/windows/downloads/index-101290.html 

    You can do the ODP.NET (ODAC) Client install WITH or WITHOUT the Visual Studio Tools. (You are prompted to select Client install at the beginning of installation prompts. 

     I prefer WITHOUT visual studio tools as I find that environment restrictive and at times buggy.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 15, 2011 10:28 PM

All replies

  • User-2005691517 posted

    As the error states, you need the Oracle client software to be installed on the server. ADO.Net uses the Oracle client software to connect to Oracle.

    This has step by step procedure http://infolab.usc.edu/csci587/Fall2011/resources/Oracle_Client_installation_tutorial.pdf

    More info here https://forums.oracle.com/forums/thread.jspa?threadID=541378

    Wednesday, September 14, 2011 9:50 AM
  • User269602965 posted

    Some pointers.

    If the LAN IP address is your development workstaition, you might have missed Orace's recommendation to install ORacle on a STATIC IP on a virtual Microsoft Loopback Adapter (see Oracle windows installation guide) with your DNS as 127.0.0.1.

    http://download.oracle.com/docs/cd/E11882_01/install.112/e16774.pdf

    Do not use the deprecated System.Data.OracleClient , instead use Oracle.DataAccess.Client  ODP.NET (ODAC)

    If Oracle 10 g is installed on the same computer as your application, then download Oracle ODP.NET 11gR2 and do the Database installation when prompted.

    If Oracle 10g is on another computer in the LAN, then install the Oracle ODP.NET 11gR2 on the application computer but select the Client installation when prompted.

    Wednesday, September 14, 2011 12:29 PM
  • User-46330738 posted

    See the situation like this:

    Actually My PC is in LAN. In my Machine windows XP service Pack2 and .net 3.5 is Installed. One more Machine is there in LAN. In the second Machine Linux is installed and Oracle 10g both. So just i want to connect with the Linux machine and access the database in my Machine. But in My machine Oracle 10g is not installed at all. So how can i make connection form the Other Linux Machine. If i connect with the machine I am geeting an error like "System.Data.OracleClient requires Oracle client software version 8.1.7 or greater."

    So please tell me the pre-requisite what ever required in my machine.

    Thursday, September 15, 2011 5:25 AM
  • User-2005691517 posted

    Install Oracle client on your machine by following the steps given in the posts above. Once Oracle client is installed on your PC, you'll be able to connect to the Oracle on linux.

    Thursday, September 15, 2011 10:28 AM
  • User269602965 posted

    If Oracle 10g is on another computer in the LAN, then install the Oracle ODP.NET 11gR2 on the application computer but select the Client installation when prompted.

    http://www.oracle.com/technetwork/database/windows/downloads/index-101290.html 

    You can do the ODP.NET (ODAC) Client install WITH or WITHOUT the Visual Studio Tools. (You are prompted to select Client install at the beginning of installation prompts. 

     I prefer WITHOUT visual studio tools as I find that environment restrictive and at times buggy.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 15, 2011 10:28 PM