ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Core Namespace / Project Class / SetDefaultGeoDatabasePath Method
The full path to the geodatabase that will be used

In This Topic
    SetDefaultGeoDatabasePath Method
    In This Topic
    Sets the current project's default geodatabase. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void SetDefaultGeoDatabasePath( 
       string defaultGeoDatabase
    )
    Public Sub SetDefaultGeoDatabasePath( _
       ByVal defaultGeoDatabase As String _
    ) 

    Parameters

    defaultGeoDatabase
    The full path to the geodatabase that will be used
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    input path cannot be resolved as default geodatabase.
    Remarks

    By default, a new file geodatabase is created in the project's home folder and used as its default geodatabase. However, the default geodatabase can be set to another existing geodatabase. For example, if you add a schema-only layer package to a map, the schema required by the layer is generated in the project's default geodatabase. A project is required to have a default geodatabase.

    The ArcGIS Pro application settings may specify a geodatabase that should always be used as the default geodatabase. Anyone using the project is expected to have write access to and appropriate permissions in that geodatabase. If a project uses a file geodatabase as the default geodatabase and the file geodatabase is not available in the specified location, a file geodatabase will be created accordingly to satisfy the default geodatabase path.

    At this time, only file geodatabases can be used as a project's default geodatabase.

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also