I have three Oracle clients.
I try this code:
Code: Select all
var c1 = new OracleConnection("User Id=user1;Password=user1;Server=SPB9879_10G_XE;Home=OraClient11g_home1;");
var c2 = new OracleConnection("User Id=user1;Password=user1;Server=XE2;Home=XEClient;");
c1.Open();
c2.Open();
c2.Open() raised Exception:
ORA-12154: TNS:could not resolve the connect identifier specified
If I will replace c1.Open() with c2.Open():
Code: Select all
var c1 = new OracleConnection("User Id=user1;Password=user1;Server=SPB9879_10G_XE;Home=OraClient11g_home1;");
var c2 = new OracleConnection("User Id=user1;Password=user1;Server=XE2;Home=XEClient;");
c2.Open();
c1.Open();
Can not load Oracle client. Check your PATH environment variable and registry settings.
But connection with default home or direct=true I can use in any time and it is not raise exceptions.
I could open connection with another Home only after restart Application. How I can resolve this problem?
Thank you.