Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Discovering Data Flow Components Programmatically

After you have added a data flow task to a package, your next step may be to determine what data flow components are available for your use. You can programmatically discover the data flow sources, transformations, and destinations that are installed and available on the local computer. For information about adding a data flow task to the package, see Adding the Data Flow Task Programmatically.

The Application class provides the PipelineComponentInfos collection, which contains a PipelineComponentInfo object for each component correctly installed on the local computer. Each PipelineComponentInfo contains information about a component such as its name, description, and creation name. You can use the value returned in the CreationName property to set the ComponentClassID property of the IDTSComponentMetaData100 when you add a component to a package.

After discovering available components, the next step is to add and configure the components, which is discussed in the next topic, Adding Data Flow Components Programmatically.

The following code sample shows how to enumerate the PipelineComponentInfos collection of the Application object to programmatically discover the data flow components available on the local computer. This sample requires a reference to the Microsoft.SqlServer.ManagedDTS assembly.

using System;
using Microsoft.SqlServer.Dts.Runtime;

namespace Microsoft.SqlServer.Dts.Samples
{
  class Program
  {
    static void Main(string[] args)
    {
      Application application = new Application();
      PipelineComponentInfos componentInfos = application.PipelineComponentInfos;

      foreach (PipelineComponentInfo componentInfo in componentInfos)
      {
        Console.WriteLine("Name: " + componentInfo.Name + "\n" +
          " CreationName: " + componentInfo.CreationName + "\n");
      }
      Console.Read();
    }
  }
}
Integration Services icon (small) Stay Up to Date with Integration Services

For the latest downloads, articles, samples, and videos from Microsoft, as well as selected solutions from the community, visit the Integration Services page on MSDN:


For automatic notification of these updates, subscribe to the RSS feeds available on the page.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.