ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Data Namespace / Geodatabase Class / Geodatabase Constructor / Geodatabase Constructor(DatabaseConnectionFile)
A physical database connection file that ends with a .sde extension.
Example

In This Topic
    Geodatabase Constructor(DatabaseConnectionFile)
    In This Topic
    Opens an enterprise geodatabase with the specified connection file. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    databaseConnectionFile
    A physical database connection file that ends with a .sde extension.
    Exceptions
    ExceptionDescription
    The information used to connect to the geodatabase is invalid.
    A geodatabase-related exception has occurred.
    This object must be created within the lambda or delegate passed to QueuedTask.Run, or on a compatible STA thread.
    Example
    Opening an Enterprise Geodatabase using sde file path
    public async Task OpenEnterpriseGeodatabaseUsingSDEFilePath()
    {
      await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
      {
        using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde"))))
        {
          // Use the geodatabase.
        }
      });
    }
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also