This is kind of a double question:
Firstly, I want to be able to list all of the TNS names in an oracle home. How do I do this?
Secondly:
I have 2 oracle homes, How do I list them? and how do I select a particular one to connect with? I have tried the connection.homes object, but although it gets the count correct, if I iterate through them, they are all 'nothing'.
I am using version 3.01.
Thanks.
TNS Names and multiple homes
We cannot reproduce your problem. Do you have Oracle client installed on your computer? Can you see Oracle homes in Info tab of "OracleConnection Editor" dialog?
Please try the following code for enumerating homes.
Please use OracleConnection.GetServerList for receiving all TNS names in Oracle home. See OraDirect .NET documentation for more details.
Please try the following code for enumerating homes.
Code: Select all
OracleHomeCollection hh = OracleConnection.Homes;
foreach(OracleHome h in hh) {
string s = h.Name;
GC.KeepAlive(s);
}