IDTSSequence.Executables Property
Returns a collection of Executable objects associated with the container. This field is read-only.
네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
구문
‘선언
ReadOnly Property Executables As Executables
Executables Executables { get; }
property Executables^ Executables {
Executables^ get ();
}
/** @property */
Executables get_Executables ()
function get Executables () : Executables
속성 값
An Executables collection that contains Executable objects associated with the container.
예
The Package class inherits from IDTSSequence and implements an Executables collection as Executables. The following code example adds the Bulk Insert task as an executable to the package, then shows the creation of the Executables collection and iterates over it, displaying the CreationName.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace Executables_API
{
class Program
{
static void Main(string[] args)
{
Package pkg = new Package();
Executable exec = pkg.Executables.Add("STOCK:BulkInsertTask");
// Obtain the collection.
Executables pgkExecs = pkg.Executables;
foreach (Executable eachExec in pgkExecs)
{
TaskHost th = exec as TaskHost;
Console.WriteLine("Executable creation name is: {0}", th.CreationName);
}
// Show that at least one executable exists.
if (pgkExecs.Contains(0))
{
Console.WriteLine("Contains returned true");
}
else
{
Console.WriteLine("Contains returned false");
}
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Namespace Executables_API
Class Program
Shared Sub Main(ByVal args() As String)
Dim pkg As Package = New Package()
Dim exec As Executable = pkg.Executables.Add("STOCK:BulkInsertTask")
' Obtain the collection.
Dim pgkExecs As Executables = pkg.Executables
Dim eachExec As Executable
For Each eachExec In pgkExecs
Dim th As TaskHost = exec as TaskHost
Console.WriteLine("Executable creation name is: {0}", th.CreationName)
Next
' Show that at least one executable exists.
If pgkExecs.Contains(0) Then
Console.WriteLine("Contains returned true")
Else
Console.WriteLine("Contains returned false")
End If
End Sub
End Class
End Namespace
Sample Output:
Executable creation name is: Microsoft.SqlServer.Dts.Tasks.BulkInsertTask.BulkInsertTask, Microsoft.SqlServer.BulkInsertTask, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
Contains returned true
스레드 보안
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
플랫폼
개발 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
대상 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
IDTSSequence Interface
IDTSSequence Members
Microsoft.SqlServer.Dts.Runtime Namespace