MainPipeClass Class
SQL Server 2008
Adds and connects components in a data flow layout.
Assembly: Microsoft.SqlServer.DTSPipelineWrap (in Microsoft.SqlServer.DTSPipelineWrap.dll)
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.
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("SSIS.Pipeline.2")).InnerObject as MainPipe; // Add the OLE DB source component. IDTSComponentMetaData100 mdOleDbSrc = mp.ComponentMetaDataCollection.New(); mdOleDbSrc.ComponentClassID = "DTSAdapter.OleDbSource"; mdOleDbSrc.Name = "OLEDB Source"; CManagedComponentWrapper wrpOledbSrc = mdOleDbSrc.Instantiate(); // Add the OLE DB destination component. IDTSComponentMetaData100 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. IDTSPath100 path = mp.PathCollection.New(); path.AttachPathAndPropagateNotifications(mdOleDbSrc.OutputCollection[0], mdOleDbDest.InputCollection[0]); } } }
