This document is archived and information here might be outdated.  Recommended version.

IVersion2.CreateChild Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IV > IVersion2 Interface > IVersion2.CreateChild Method
ArcGIS Developer Help

IVersion2.CreateChild Method

Creates a new child version of this version whose initial state is the current state of pInitialStateVersion.

[Visual Basic .NET]
Public Function CreateChild ( _
    ByVal Name As String, _
    ByVal initialStateVersion As IVersion _
) As IVersion
public IVersion CreateChild (
    string Name,
    IVersion initialStateVersion
HRESULT CreateChild(
  BSTR Name,
  IVersion* initialStateVersion
Name [in]

Name is a parameter of type BSTR initialStateVersion [in]
initialStateVersion is a parameter of type IVersion*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


This method is intended for developers who require custom workflows such as creating a version with an initial state that references a version other than that of the parent version. To create a child version with the same initial state as the parent version, use the IVersion.CreateVersion method.


The example below assumes the existence of a version named QA that has a child version named EditorA. A new version, EditorB, is being created as a child version of the QA version, but rather than initially referencing the same state of the parent QA version, it will reference the same state of its sibling version, EditorA.


public void CreateChildExample(IWorkspace workspace)
      // Open the QA and EditorA versions.
      IVersionedWorkspace versionedWorkspace = (IVersionedWorkspace)workspace;
      IVersion2 qaVersion = (IVersion2)versionedWorkspace.FindVersion("QA");
      IVersion2 editorAVersion = (IVersion2)versionedWorkspace.FindVersion("EditorA");
      // Create EditorB with the same state as EditorA.
      IVersion2 editorBVersion = (IVersion2)qaVersion.CreateChild("EditorB", editorAVersion);

See Also

IVersion2 Interface