This documentation is archived and is not being maintained.

MainPipeClass Class

Adds and connects components in a data flow layout.

Namespace: Microsoft.SqlServer.Dts.Pipeline.Wrapper
Assembly: Microsoft.SqlServer.DTSPipelineWrap (in microsoft.sqlserver.dtspipelinewrap.dll)

[ClassInterfaceAttribute(0)] 
[GuidAttribute("C3BF9DC1-4715-4694-936F-D3CFDA9E42C5")] 
[TypeLibTypeAttribute(2)] 
public class MainPipeClass : IDTSPipeline90, MainPipe, IDTSObjectModel90
/** @attribute ClassInterfaceAttribute(0) */ 
/** @attribute GuidAttribute("C3BF9DC1-4715-4694-936F-D3CFDA9E42C5") */ 
/** @attribute TypeLibTypeAttribute(2) */ 
public class MainPipeClass implements IDTSPipeline90, MainPipe, 
	IDTSObjectModel90
ClassInterfaceAttribute(0) 
GuidAttribute("C3BF9DC1-4715-4694-936F-D3CFDA9E42C5") 
TypeLibTypeAttribute(2) 
public class MainPipeClass implements IDTSPipeline90, MainPipe, 
	IDTSObjectModel90

This class represents the data flow task, and is used when programmatically building a data flow layout. An instance of the class is created by adding the data flow task to the Executables collection of a Package. Components are added to the task using the ComponentMetaDataCollection property. Connections are established between components using the PathCollection property.


System.Object
  Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipeClass

The following code example adds a data flow task to a package, adds an OLE DB source component and an OLE DB destination component, and establishes a path between the two components.

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

namespace Microsoft.Samples.SqlServer.Dts
{
    public class Class1
    {
        public static void Main(string []args)
        {
            // Create the package.
            Package p = new Package();

            // Add the data flow task.
            MainPipe mp = ((TaskHost)p.Executables.Add("DTS.Pipeline")).InnerObject as MainPipe;

            // Add the OLE DB source component.
            IDTSComponentMetaData90 mdOleDbSrc = mp.ComponentMetaDataCollection.New();
            mdOleDbSrc.ComponentClassID = "DTSAdapter.OleDbSource";
            mdOleDbSrc.Name = "OLEDB Source";
            CManagedComponentWrapper wrpOledbSrc = mdOleDbSrc.Instantiate();

            // Add the OLE DB destination component.
            IDTSComponentMetaData90 mdOleDbDest = mp.ComponentMetaDataCollection.New();
            mdOleDbDest.ComponentClassID = "DTSAdapter.OleDbDestination";
            mdOleDbDest.Name = "OLEDB Destination";
            CManagedComponentWrapper wrpOledbDest = mdOleDbSrc.Instantiate();

            // Create a path and attach the output of the source to the input of the destination.
            IDTSPath90 path = mp.PathCollection.New();
            path.AttachPathAndPropagateNotifications(mdOleDbSrc.OutputCollection[0], mdOleDbDest.InputCollection[0]);
        }
    }
}

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.

Development Platforms

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

Target Platforms

Show: