0
Answer

Connection String to Oracle DB

vandana

vandana

18y
2k
1
 am an absolute beginner with .NET.

I am stuck on a connection string issue and was wondering if you could please help me…I would be grateful if you could provide any suggestions.

I am developing on oracle 9i db and .NET 2.0 using C#

I am connected to my local database (on my laptop). i put the connection string in the web.config file under appSettings:

<add key=”oracleConn” value=”PROVIDER=OraOLEDB; DATA Source=DEVP; UserId=ADWC;Password=ADWC” />

I then used this string in my .cs file to make a connection:

conOracle= new OleDbConnection(ConfigurationsSettings.AppSettings[“oracleConn”]);

I have the following command:

(query is a sql query string – I tested it in sql and it works fine)

cmdSelectRoom= new OleDbCommand(query, conOracle);

conOracle.Open();

this is where the application bombs…it gives me a message saying

System.InvalidOperationException: “The ‘OraOLEDB’ provider is not registered on the local machine.”

I went to my Oracle home directory

Modified in the security tab of the properties window, under Authenticated Users, re-checked the “Read and Execute” box in the Permissions list and made sure it applied to the folder and subfolders/files, and rebooted…still the same problem. 

Someone suggested I try

<add key=”oracleConn” value=”PROVIDER=msdaora; DATA Source=DEVP; UserId=ADWC;Password=ADWC” />

But that gives me yet another error :

System.Data.OleDb.OleDbException: Oracle error occurred, but error message could not be retrieved from Oracle.

 Thanks for your help