ForEachEnumeratorHost.CollectionEnumerator Property


Gets or sets a Boolean that indicates if the hosting enumerator is enumerating collections of objects or enumerating collections of collections.

Namespace:   Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

Public Property CollectionEnumerator As Boolean

Property Value

Type: System.Boolean

A Boolean that indicates what the enumerator is iterating over.

true indicates that the enumerator is iterating over a collection of collections. If false, the enumerator is iterating over a collection of objects.

The following code example creates a ForEachEnumeratorHost to hold a ForEachSMOEnumerator enumerator, and displays the host properties.

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime.Enumerators.SMO
Imports Microsoft.SqlServer.Dts.Runtime

Namespace Microsoft.SqlServer.SSIS.Sample
    Friend Class EnumType
        Public const String SMOEnum = "Foreach SMO Enumerator"
    End Class
    Class Program
        Shared  Sub Main(ByVal args() As String)
            Dim app As Application =  New Application() 
            Dim infos As ForEachEnumeratorInfos =  app.ForEachEnumeratorInfos 
            Dim info As ForEachEnumeratorInfo =  Nothing 

            Dim enumInfo As ForEachEnumeratorInfo
            For Each enumInfo In infos
                Console.Write("Available enumerators: {0}\n", enumInfo.Name)
                If enumInfo.Name = EnumType.SMOEnum Then
                    ' Set the ForEachEnumeratorInfo variable
                    ' to the SMo enumerator, and use it 
                    ' later in the CreateNew method.
                    info = enumInfo
                End If
            Dim enumH As ForEachEnumeratorHost =  info.CreateNew() 
            Console.WriteLine("Host InnerObject: " + enumH.InnerObject.ToString())
            Console.WriteLine("CollectionEnumerator? {0}", enumH.CollectionEnumerator)
            Console.WriteLine("CreationName: {0}",  enumH.CreationName)
            Console.WriteLine("Description:  {0}", enumH.Description)
            Console.WriteLine("Value of DelayValidation: {0}", enumH.DelayValidation)
            Console.WriteLine("HostType:    {0}", enumH.HostType)
            Console.WriteLine("ID:          {0}", enumH.ID)
            Console.WriteLine("Name:        {0}", enumH.Name)
        End Sub
    End Class
End Namespace

Sample Output:

Available enumerators: Foreach File Enumerator

Available enumerators: Foreach Item Enumerator

Available enumerators: Foreach ADO Enumerator

Available enumerators: Foreach ADO.NET Schema Rowset Enumerator

Available enumerators: Foreach From Variable Enumerator

Available enumerators: Foreach NodeList Enumerator

Available enumerators: Foreach SMO Enumerator

Host InnerObject: Microsoft.SqlServer.Dts.Runtime.Enumerators.SMO.ForEachSMOEnumerator

CollectionEnumerator? False

CreationName: Microsoft.SqlServer.Dts.Runtime.Enumerators.SMO.ForEachSMOEnumerator, Microsoft.SqlServer.ForEachSMOEnumerator, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91


Value of DelayValidation: False

HostType: ForEachEnumerator

ID: {C91BA4D0-6AD4-4BEE-A7C4-9A737880773E}

Name: {C91BA4D0-6AD4-4BEE-A7C4-9A737880773E}

Return to top