dotConnect for Oracle Documentation
Devart.Data.Oracle Namespace / OracleDataSourceEnumerator Class
Members Example

In This Topic
    OracleDataSourceEnumerator Class
    In This Topic
    Provides a mechanism for enumerating all known Oracle servers (TNS aliases).
    Syntax
    'Declaration
     
    Public NotInheritable Class OracleDataSourceEnumerator 
       Inherits System.Data.Common.DbDataSourceEnumerator
    public sealed class OracleDataSourceEnumerator : System.Data.Common.DbDataSourceEnumerator 
    Example
    This sample shows the use of OracleDataSourceEnumerator class.
    OracleHomeCollection homes = OracleConnection.Homes;
    foreach (OracleHome h in homes) {
        Console.WriteLine("=== Home={0} ===", h.Name);
        OracleDataSourceEnumerator en = new OracleDataSourceEnumerator();
        DataTable tbl = en.GetDataSources(h.Name);
        foreach (DataRow row in tbl.Rows) {
            Console.WriteLine(row["InstanceName"]);
        }
    }
    Console.ReadLine();
    Dim homes As OracleHomeCollection = OracleConnection.Homes
    For Each h As OracleHome In homes
            Console.WriteLine("=== Home={0} ===", h.Name)
        Dim en As New OracleDataSourceEnumerator()
        Dim tbl As DataTable = en.GetDataSources(h.Name)
        For Each row As DataRow In tbl.Rows
                    Console.WriteLine(row("InstanceName"))
            Next
    Next
    Console.ReadLine()
    Inheritance Hierarchy

    System.Object
       System.Data.Common.DbDataSourceEnumerator
          Devart.Data.Oracle.OracleDataSourceEnumerator

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also