Page 1 of 1

TNS Names and multiple homes

Posted: Wed 25 Jan 2006 15:14
by kevinherring
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.

Posted: Thu 26 Jan 2006 12:07
by Paul
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.

Code: Select all

      OracleHomeCollection hh = OracleConnection.Homes;
      foreach(OracleHome h in hh) {
        string s = h.Name;
        GC.KeepAlive(s);
      }
Please use OracleConnection.GetServerList for receiving all TNS names in Oracle home. See OraDirect .NET documentation for more details.