Initializes a new instance of the Geodatabase class and opens a connection to the geodatabase using specified by the file path.

Namespace:  ESRI.ArcGISExplorer.Data

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: (


public Geodatabase(
	string pathToGeodatabase
Visual Basic (Declaration)
Public Sub New ( _
	pathToGeodatabase As String _


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.


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.
//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"
'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"


System.IO..::.DirectoryNotFoundExceptionThe Geodatabase could not be located using the supplied path.

See Also