DTSObjectHostType 枚举

定义

说明承载其他任务或容器的容器类型。

public enum class DTSObjectHostType
public enum DTSObjectHostType
type DTSObjectHostType = 
Public Enum DTSObjectHostType
继承
DTSObjectHostType

字段

ConnectionManager 1

宿主为连接管理器。

ForEachEnumerator 3

宿主为 Foreach 枚举器。

LogProvider 2

宿主为日志提供程序。

Task 0

宿主为任务。

示例

下面的代码示例创建一个包,并向 Sequence 其中添加一个容器。 FileSystemTask然后,将添加到任务宿主,并 HostType 检查属性,并从枚举返回一个值 DTSObjectHostType

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  

示例输出:

主机类型:任务

适用于