This discussion is archived
2 Replies Latest reply: Oct 22, 2013 3:49 PM by 72d18980-ba5f-4188-b37c-5f68ee967e52 RSS

Issues getting visual studio C# to detect ado connector

72d18980-ba5f-4188-b37c-5f68ee967e52 Newbie
Currently Being Moderated

I'm trying to connect to an oracle database. I already installed the ODAC121010_x64 driver and I am still having issues getting the system to connect. I know the connector works because I have a MS word addin that tests the connectivity and Its able to obtain connectivity.

 

 

I am running windows 7 64bit

Visual studio 2012.

Below is my connection string:

"Data Source=oracle.abcdefg.net:1521;Persist Security Info=True;User ID=xx;Password=xx;"

 

To test for connectivity I run the code below:

 

public static bool IsOracleDotNetConnectorInstalled

        {

            get

            {

                try

                {

                    DataTable providers = DbProviderFactories.GetFactoryClasses();

                    foreach (DataRow row in providers.Rows)

                    {

                        string providerClass = ((string)row[2]).ToLower();

                        if (providerClass.StartsWith("oracle.manageddataaccess.client") || providerClass.StartsWith("oracle.dataaccess.client"))

                            return true;

                    }

                    return false;

                }

                catch (Exception)

                {

                    return false;

                }

            }

        }

 

 

This code always returns false

 

Thanks In advance,

 

PS: I get the feeling the error pertains to the string I am trying to compare, which might not be compatible with ODAC121010

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points