ArcGIS Explorer Component Help |
Geodatabase Constructor (String) |
Geodatabase Class Example See Also |
Initializes a new instance of the Geodatabase class and opens a connection to the geodatabase using
specified by the file path.
Namespace:
ESRI.ArcGISExplorer.DataAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public Geodatabase( string pathToGeodatabase ) |
Visual Basic (Declaration) |
---|
Public Sub New ( _ pathToGeodatabase As String _ ) |
Parameters
- pathToGeodatabase
- Type: System..::.String
The path to a file geodatabase (.gdb) or to an ArcSDE spatial database connection file (.sde). In both cases include the file extension.
Return Value
A Geodatabase object representing the actual ESRI geodatabase data storage container.Examples
The code below creates a new Geodatabase object and opens a file geodatabase then prints out some information about the connection and the geodatabase type.
CopyC#
//Connect to a file geodatabase Geodatabase fileGdb = new Geodatabase(@"C:\Data\Scotland.gdb"); //Print the type of geodatabase System.Diagnostics.Debug.Print(fileGdb.Type.ToString()); //prints "File" //Print the geodatabase path System.Diagnostics.Debug.Print(fileGdb.Path); //prints "C:\Data\Scotland.gdb" //Print the short name for the geodatabase System.Diagnostics.Debug.Print(fileGdb.Name); //prints "Scotland.gdb" //Print the short name for the geodatabase System.Diagnostics.Debug.Print(fileGdb.ShortName); //prints "Scotland"
CopyVB.NET
'Connect to a file geodatabase Dim fileGdb As Geodatabase = New Geodatabase("C:\Data\Scotland.gdb") 'Print the type of geodatabase System.Diagnostics.Debug.Print(fileGdb.Type) 'prints "File" 'Print the geodatabase path System.Diagnostics.Debug.Print(fileGdb.Path) 'prints "C:\Data\Scotland.gdb" 'Print the short name for the geodatabase System.Diagnostics.Debug.Print(fileGdb.Name) 'prints "Scotland.gdb" 'Print the short name for the geodatabase System.Diagnostics.Debug.Print(fileGdb.ShortName) 'prints "Scotland"
Exceptions
Exception | Condition |
---|---|
System.IO..::.DirectoryNotFoundException | The Geodatabase could not be located using the supplied path. |