I am having problems connecting to an Oracle database from my C# WCF service. In the WCF service I am already connecting to multiple DB2 and SQL databases successfully via the following ole connection string.
mySqlStmt = "select * from myfile"
myConnectionString = "Provider=sqloledb; Data Source=DEV\SQLEXPRESS;Initial Catalog=MyDataBase;User Id=user123; Password=pass123"
OleDBConnection conn = new OleDBConnection(myConnectionString);
OleDbCommand cmd = new OleDbCommand(mySqlStmt, conn);
This has worked well for me. However I now need to connect to an Oracle database with the existing software. I have been given the connection details
User Id= User123
I downloaded Oracle XE to our Windows 2012 server and updated the TNSNAMES.ORA file with the connection details and then created a .UDL file to test the connection to the oracle database. By keying in the above Data Source, User name and Password to the test connection properties I got "Test connection Succeeded
" The Oracle provider listed in the test connection is "Oracle Provider for OLE DB"
I then set up a new connection string in my application as follows:
Provider=OraOLEDB.Oracle;Data Source=TestDB;User Id=User123;Password=Pass123;
However when my application tries to connect to the database via my application I get an error message "OraOLEDB.Oracle provider is not registered on the local machine
The Test Connection does not specify OraOLEDB.Oracle when it successfully connects and I thought that by downloading Oracle XE that I would automatically have the required driver. Appreciate any help I can get to make this connection