ArcObjects Library Reference  (GeoDatabaseDistributed)    

DataElements Example

[C#]

public void ListDatasets(IGeoDataServer geodataserver)
{
    // Set the browse options to return the feature classes, tables and
feature datasets in a geodataserver
    IDEBrowseOptions deBrowseOptions = new DEBrowseOptionsClass();
    deBrowseOptions.ExpandType = esriDEExpandType.esriDEExpandDescendants;
    deBrowseOptions.RetrieveFullProperties = true;
    deBrowseOptions.RetrieveMetadata = true;

    // Get the list of root level ture classes, tables and feature datasets and print them out
    IDataElements dataElements = geodataserver.get_DataElements(deBrowseOptions);
    string elements;
    int dataElementsCount = dataElements.Count;
    for (int i = 0; i < dataElementsCount; i++)
    {
        IDataElement dataElement = dataElements.get_Element(i);
        Console.WriteLine(dataElement.Name);
        if (dataElement.ChildrenExpanded)
        {
            IArray dataElements2 = dataElement.Children;
            for (int j = 0; j < dataElements2.Count; j++)
            {
                IDataElement dataElement2 = (IDataElement)dataElements2.get_Element(j);
                Console.WriteLine(dataElement2.Name);
            }
        }
    }
}


[Visual Basic 6.0, Visual Basic .NET, C++]
No example is available for Visual Basic 6.0, Visual Basic .NET, or C++. To view a C# example, click the Language Filter button Language Filter in the upper-left corner of the page.