TaskHost.HostType 속성

정의

컨테이너의 호스트에 대해 설명하는 DTSObjectHostType 열거형의 값을 가져옵니다. 이 속성은 읽기 전용입니다.

public:
 property Microsoft::SqlServer::Dts::Runtime::DTSObjectHostType HostType { Microsoft::SqlServer::Dts::Runtime::DTSObjectHostType get(); };
[System.ComponentModel.Browsable(false)]
public Microsoft.SqlServer.Dts.Runtime.DTSObjectHostType HostType { get; }
[<System.ComponentModel.Browsable(false)>]
member this.HostType : Microsoft.SqlServer.Dts.Runtime.DTSObjectHostType
Public ReadOnly Property HostType As DTSObjectHostType

속성 값

DTSObjectHostType 열거자입니다.

구현

특성

예제

다음 코드 예제에서는 패키지를 만들고 컨테이너를 Sequence 추가합니다. 그런 다음 A 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  

샘플 출력:

호스트 유형: 작업

적용 대상