ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Data Namespace / DatabaseClient Class / GetDatabaseConnectionProperties Method
A valid database connection file.
Example

In This Topic
    GetDatabaseConnectionProperties Method
    In This Topic
    Syntax
    public static DatabaseConnectionProperties GetDatabaseConnectionProperties( 
       DatabaseConnectionFile databaseConnectionFile
    )
    Public Shared Function GetDatabaseConnectionProperties( _
       ByVal databaseConnectionFile As DatabaseConnectionFile _
    ) As DatabaseConnectionProperties

    Parameters

    databaseConnectionFile
    A valid database connection file.

    Return Value

    The corresponding DatabaseConnectionProperties.
    Exceptions
    ExceptionDescription
    databaseConnectionFile is null.
    The information used to connect to the geodatabase is invalid.
    A geodatabase-related exception has occurred.
    Example
    Getting Database Connection Properties from a Connection File
    DatabaseConnectionFile connectionFile = new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde"));
    DatabaseConnectionProperties connectionProperties = DatabaseClient.GetDatabaseConnectionProperties(connectionFile);
    
    // Now you could, for example, change the user name and password in the connection properties prior to use them to open a geodatabase
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also