Share via


ReferenceValue.Subcomponents Method

The Subcomponents method creates a new ReferenceValue object that contains a set of subcomponents of this ReferenceValue object.

Syntax

public ReferenceValue Subcomponents(
  Int32 startingComponent,
  Int32 endingComponent
);
Public Function Subcomponents( _
  ByVal startingComponent As Int32, _
  ByVal endingComponent As Int32 _
) As ReferenceValue

Parameters

  • startingComponent
    The zero-based index of the first distinguished name element to include in the subcomponent. The created subcomponent includes the first distinguished name element. This value must be less than endingComponent.

  • endingComponent
    The zero-based index of the first distinguished name element to exclude from the subcomponent. The created subcomponent does not include the name element that is contained in this parameter. This value must be greater than startingComponent.

Return Value

Returns a ReferenceValue object that contains the specified subcomponents.

Exceptions

Exception type Condition
ArgumentOutOfRangeException

One of the following cases:

  • The startingComponent or endingComponent value is not valid in the ReferenceValue object.
  • The startingComponent value is greater than or equal to endingComponent.
  • The startingComponent or endingComponent value is greater than the depth of the ReferenceValue object that is provided by the ReferenceValue.Depth property.

Remarks

The following VB example shows how the Subcomponents method returns the second and third components of the distinguished name. The output of this code will be "dc=domain,dc=fabrikam".

Examples


ReferenceValue dn = Utils.MAs["ADMA"].CreateDN("cn=jeffsmith,dc=domain,dc=fabrikam,dc=com");
ReferenceValue dnSub = dn.Subcomponents(1, 3);
System.Diagnostics.Debug.WriteLine(dnSub.ToString());

Requirements

Product ILM 2007 FP1
Namespace Microsoft.MetadirectoryServices
Assembly Microsoft.MetadirectoryServices
.NET Framework .NET Framework 2.0

See Also

ReferenceValue

Send comments about this topic to Microsoft

Build date: 2/16/2009