Export (0) Print
Expand All

Package.Executables Property

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

Namespace:  Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

public Executables Executables { get; }

Property Value

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

Implements

IDTSSequence.Executables

For more information, see Integration Services Containers.

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");
            }
        }
    }
}

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft