Export (0) Print
Expand All

Executable Constructor

Initializes a new instance of the Executable class.

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

protected Executable ()
protected Executable ()
protected function Executable ()

The default constructor initializes any fields to their default values.

The Package class is a child of the Executables class through several levels of inheritance. The following code example shows how to use the Executable class with a package to add a Bulk Insert task executable to the Executables collection of the package.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.BulkInsertTask;

namespace Executables_API
{
        class Program
        {
                static void Main(string[] args)
                {
                    // Create the package and add the BulkInsertTask.
                    Package pkg = new Package();
                    Executable exec = pkg.Executables.Add("STOCK:BulkInsertTask");
                    TaskHost myTask = exec as TaskHost;
                    BulkInsertTask myBI = myTask.InnerObject as BulkInsertTask;
                    myBI.DebugMode = false;
                    myBI.CheckConstraints = false;
                    myBI.KeepIdentity = true;

                    // Obtain the collection.
                    Executables pgkExecs = pkg.Executables;
                    // Show the number of executables in the collection.
                    Console.WriteLine("The first package contains {0} executables", pgkExecs.Count);
                }
        }
}

Sample Output:

The first package contains 1 executables

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

Community Additions

ADD
Show:
© 2014 Microsoft