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

In This Topic
    GetVersion Method (VersionManager)
    In This Topic
    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
    )
    Public Function GetVersion( _
       ByVal name As String _
    ) As Version

    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.0 or higher.
    See Also