DTSObjectHostType Enumeración

Definición

Describe el tipo de contenedor que está hospedando la otra tarea o contenedor.

public enum class DTSObjectHostType
public enum DTSObjectHostType
type DTSObjectHostType = 
Public Enum DTSObjectHostType
Herencia
DTSObjectHostType

Campos

ConnectionManager 1

El host es un administrador de conexiones.

ForEachEnumerator 3

El host es un enumerador Foreach.

LogProvider 2

El host es un proveedor de registro

Task 0

El host es una tarea.

Ejemplos

En el ejemplo de código siguiente se crea un paquete y se agrega un Sequence contenedor a él. A FileSystemTask continuación, se agrega un elemento al host de tareas y se revisa la HostType propiedad y se devuelve un valor de la DTSObjectHostType enumeración.

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  
using Microsoft.SqlServer.Dts.Tasks.FileSystemTask;  

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class mySample  
    {  
        static void Main(string[] args)  
        {  
            Package package = new Package();  
            Sequence seq = (Sequence)package.Executables.Add("STOCK:SEQUENCE");  

            // Add a File System task.  
            Executable eFileTask1 = seq.Executables.Add("STOCK:FileSystemTask");  
            TaskHost thFileTask1 = eFileTask1 as TaskHost;  

            // Use the TaskHost variable to find the DtsObjectHostType.  
            DTSObjectHostType hType = thFileTask1.HostType;  
            Console.WriteLine("Host Type: {0}", hType);  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  
Imports Microsoft.SqlServer.Dts.Tasks.FileSystemTask  

Namespace Microsoft.SqlServer.SSIS.Samples  
    Class mySample  
        Shared  Sub Main(ByVal args() As String)  
            Dim package As Package =  New Package()   
            Dim seq As Sequence = CType(package.Executables.Add("STOCK:SEQUENCE"), Sequence)  

            ' Add a File System task.  
            Dim eFileTask1 As Executable =  seq.Executables.Add("STOCK:FileSystemTask")   
            Dim thFileTask1 As TaskHost =  eFileTask1 as TaskHost   

            ' Use the TaskHost variable to find the DtsObjectHostType.  
            Dim hType As DTSObjectHostType =  thFileTask1.HostType   
            Console.WriteLine("Host Type: {0}", hType)  
        End Sub  
    End Class  
End Namespace  

Salida del ejemplo:

Tipo de host: tarea

Se aplica a