Can't connect to Oracle
Posted: Fri 22 Jun 2012 17:12
I keep getting the following Oracle Exception message:
"Can not obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server."
when I try to connect to Oracle in my C# code:
OracleConnection conn;
conn = new OracleConnection("User Id=foouser;Password=foopassword;Server=//fooserver:1521/foosid;");
conn.Open(); //Oracle Exception occurs
When I add the following line:
conn.Direct = true;
It says that it cannot find my host:
"ORA-12545: Connect failed because target host or object does not exist <Host = //servername:1521/sidname:1521>"
- which is completely false, as I can connect to my database using SqlDeveloper and the exact same connection details without a problem.
This used to work before even without the conn.Direct = true, statement. This is so perplexing and I don't know what could be causing it!
Any ideas what else I can try??
"Can not obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server."
when I try to connect to Oracle in my C# code:
OracleConnection conn;
conn = new OracleConnection("User Id=foouser;Password=foopassword;Server=//fooserver:1521/foosid;");
conn.Open(); //Oracle Exception occurs
When I add the following line:
conn.Direct = true;
It says that it cannot find my host:
"ORA-12545: Connect failed because target host or object does not exist <Host = //servername:1521/sidname:1521>"
- which is completely false, as I can connect to my database using SqlDeveloper and the exact same connection details without a problem.
This used to work before even without the conn.Direct = true, statement. This is so perplexing and I don't know what could be causing it!
Any ideas what else I can try??