ArcGIS Explorer Component Help |
Table..::.RootDataContainer Property |
Table Class Example See Also |
Gets the object which represents the physical storage container on disk.
Namespace:
ESRI.ArcGISExplorer.DataAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public Object RootDataContainer { get; } |
Visual Basic (Declaration) |
---|
Public ReadOnly Property RootDataContainer As Object |
Field Value
An object representing the data container which could either be a Geodatabase or a DataDirectory.Examples
The code below demonstrates how to use the RootDataContainer property to return a reference to the actual
data container, which in the example is a Geodatabase object.
CopyC#
//Open a file geodatabase feature class Table someTable = Table.OpenFileGeodatabaseTable(@"C:\Data\World.gdb", "countries"); //Return reference to the data container object container = someTable.RootDataContainer; //Check to see what type of container it is if (container is Geodatabase) { //Cast the object to a Geodatabase Geodatabase gdb = container as Geodatabase; //Return the type of geodatabase GeodatabaseType gdbType = gdb.Type; } else if (container is DataDirectory) { //Cast the object to a DataDirectory DataDirectory dataDir = container as DataDirectory; //Return the path to the directory which contains the Table string fodlerPath = dataDir.Path; }
CopyVB.NET
'Open a file geodatabase feature class Dim someTable As Table = Table.OpenFileGeodatabaseTable("C:\Data\World.gdb", "countries") 'return reference to the data container Dim container As Object = someTable.RootDataContainer 'Check to see what type of container it is If TypeOf container Is Geodatabase Then 'Cast the object to a Geodatabase Dim gdb As Geodatabase = DirectCast(container, Geodatabase) 'Return the type of geodatabase Dim gdbType As GeodatabaseType = gdb.Type ElseIf TypeOf container Is DataDirectory Then 'Cast the object to a DataDirectory Dim dataDir As DataDirectory = DirectCast(container, DataDirectory) 'Return the path to the directory which contains the Table Dim fodlerPath As String = dataDir.Path End If