ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data Namespace / VersionManager Class / GetVersion Method
The name of the Version to return.
Example Version

GetVersion Method (VersionManager)
Gets a Version object with the specified name. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public Version GetVersion( 
   string name
)

Parameters

name
The name of the Version to return.

Return Value

The Version that corresponds to name.
Exceptions
ExceptionDescription
A geodatabase-related exception has occurred.
This method or property must be called within the lambda passed to QueuedTask.Run
Example
Connecting to a Version
public Geodatabase ConnectToVersion(Geodatabase geodatabase, string versionName)
{
    Geodatabase connectedVersion = null;

    if (geodatabase.IsVersioningSupported())
    {
        using (VersionManager versionManager = geodatabase.GetVersionManager())
        using (Version version = versionManager.GetVersion(versionName))
        {
            connectedVersion = version.Connect();
        }
    }
    return connectedVersion;
}
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also