TaskHost.HostType 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从说明容器宿主的 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
示例输出:
主机类型:任务