ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Data Namespace / DatabaseConnectionFile Class / DatabaseConnectionFile Constructor
A valid path to a database connection file that ends with the .sde extension.
Example

In This Topic
    DatabaseConnectionFile Constructor
    In This Topic
    Initializes a new instance of the DatabaseConnectionFile class.
    Syntax
    public DatabaseConnectionFile( 
       Uri path
    )
    Public Function New( _
       ByVal path As Uri _
    )

    Parameters

    path
    A valid path to a database connection file that ends with the .sde extension.
    Exceptions
    ExceptionDescription
    path is null.
    The path in path does not end with the .sde extension.
    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