ArcGIS Explorer Component Help |
Table..::.Parent Property |
Table Class Example See Also |
Gets the parent data container by taking a hierarchical view of the geodatabase.
Namespace:
ESRI.ArcGISExplorer.DataAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
Field Value
An Object representing the parent data container which could be a GeodatabaseFolder, a Geodatabase or a DataDirectory.Remarks
The object returned by this property will be one of the following types:
- A GeodatabaseFolder object if the Table object represents a feature class contained within a feature dataset.
- A Geodatabase object if the Table is non-spatial or if the Table represents feature class that is not stored in a feature dataset.
- A DataDirectory object if the Table represents either a dBase file or shapefile.
You can use the RootDataContainer property to directly access either the Geodatabase or DataDirectory in which the Table is stored.
Examples
The code below demonstrates how to use the Parent property to return a reference to the GeodatabaseFolder (feature
dataset) which contains the Table (feature class).
CopyC#
//Open geodatabase Geodatabase gdb = new Geodatabase(@"C:\Data\CalgaryData2.gdb"); //Open the Seats feature class which is contained in a feature dataset called Parks Table seatsTable = gdb.OpenTable("Seating"); //return the parent container object parentObject = seatsTable.Parent; if (parentObject is GeodatabaseFolder) { //Cast the object to a GeodatabaseFolder object GeodatabaseFolder folder = parentObject as GeodatabaseFolder; if (folder != null) { //Print out the Name property System.Diagnostics.Debug.Print(folder.Name); //Prints 'Parks' } }
CopyVB.NET
'Open geodatabase Dim gdb As Geodatabase = New Geodatabase("C:\Data\CalgaryData2.gdb") 'Open the Seats feature class which is contained in a feature dataset called Parks Dim seatsTable As Table = gdb.OpenTable("Seating") 'return the parent container Dim parentObject As Object = seatsTable.Parent If TypeOf parentObject Is GeodatabaseFolder Then 'Cast the object to a GeodatabaseFolder object Dim folder As GeodatabaseFolder = DirectCast(parentObject, GeodatabaseFolder) If Not folder Is Nothing Then 'Print out the Name property System.Diagnostics.Debug.Print(folder.Name) 'Prints 'Parks' End If End If