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 コンテナーを追加します。 次に 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  

サンプル出力:

Host Type: Task

適用対象