Export (0) Print
Expand All

IDTSPath100.AttachPathAndPropagateNotifications Method

Establishes a path between two components and notifies the affected components.

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

void AttachPathAndPropagateNotifications(
	IDTSOutput100 pIDTSOutput,
	IDTSInput100 pIDTSInput


Type: Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSOutput100
The output of the upstream component.
Type: Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSInput100
The input of the downstream component.

In addition to establishing the flow of data between an IDTSOutput100 and an IDTSInput100 input, this method also notifies each component of the event by calling the OnInputPathAttached and OnOutputPathAttached methods of the component.

The following code example demonstrates how to create a new path and establish the path between two components.

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


    public static void main( string []args )
        // Create the package and add a data flow task.
        Package p = new Package();
        TaskHost th = p.Executables.Add("DTS.Pipeline",null) as TaskHost;
        MainPipe m = th.InnerObject as MainPipe;

        // Create an OLE DB source component.
        IDTSComponentMetaData100 md = AddComponentToDataFlow( m , "DTSAdapter.OLEDBSource");
        IDTSComponentMetaData100 oledbSrc = m.ComponentMetaDataCollection.New();
        CManagedComponentWrapper100 srcWrp = oledbSrc.Instantiate();

        // Create an OLE DB destination component.
        IDTSComponentMetaData100 oledbDest = AddComponentToDataFlow( m , "DTSAdapter.OLEDBDestination");
        IDTSComponentMetaData100 destWrp = oledbDest.ComponentMetaDataCollection.New();
        CManagedComponentWrapper100 destWrp = md.Instantiate();

        // Establish the path.
        IDTSPath100 path = m.PathCollection.New();
        path. AttachPathAndPropagateNotifications( oledbSrc.OutputCollection[0], oledbDest.InputCollection[0]);

public IDTSComponentMetaData100 AddComponentToDataFlow( MainPipe mp , string Component )
    if( mp != null )
        IDTSComponentMetaData100 md = mp.ComponentMetaDataCollection.New();
        md.ComponentClassID = Component;
        CManagedComponentWrapper wrp = md.Instantiate();

        return md;
    throw new Exception( "DataFlow task does not exist.");

Community Additions

© 2014 Microsoft