I am able to get a successful connection to an Oracle database as can be seen in the image below:
However, when I try to connect and make a query through code, I get the error:
"
ERROR: Message:System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'OraOps12.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Oracle.DataAccess.Client.OpsInit.CheckVersionCompatibility(String version)
at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleConnection..cctor()
--- End of inner exception stack trace ---
at Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
"
on the line for Oracle connection:
string oradb = "Data Source=" + oracleDataSource + ";User Id=" + oracleUserID + ";Password=" + oraclePassword + ";";
OracleConnection conn = new OracleConnection(oradb); <----error thrown here
The credentials are the same as enetered in the server explorer
How do I fix this?