Package.Executables 属性

Gets the collection of executable objects contained within the package that are a part of the package workflow.

命名空间:  Microsoft.SqlServer.Dts.Runtime
程序集:  Microsoft.SqlServer.ManagedDTS(在 Microsoft.SqlServer.ManagedDTS.dll 中)

语法

声明
Public ReadOnly Property Executables As Executables 
    Get
用法
Dim instance As Package 
Dim value As Executables 

value = instance.Executables
public Executables Executables { get; }
public:
virtual property Executables^ Executables {
    Executables^ get () sealed;
}
abstract Executables : Executables 
override Executables : Executables
final function get Executables () : Executables

属性值

类型:Microsoft.SqlServer.Dts.Runtime.Executables
The collection of executable objects contained within the package.

实现

IDTSSequence.Executables

注释

For more information, see Integration Services 容器.

示例

The following code example adds the Bulk Insert task as an executable to the package, then creates 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=10.0.000.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91

Contains returned true

请参阅

参考

Package 类

Microsoft.SqlServer.Dts.Runtime 命名空间