Leer en inglés

Compartir a través de


IDTSPath100.AttachPathAndPropagateNotifications Método

Definición

C#
[System.Runtime.InteropServices.DispId(104)]
public void AttachPathAndPropagateNotifications (Microsoft.SqlServer.Dts.Pipeline.Wrapper.Sql2012.IDTSOutput100 pIDTSOutput, Microsoft.SqlServer.Dts.Pipeline.Wrapper.Sql2012.IDTSInput100 pIDTSInput);

Parámetros

pIDTSOutput
IDTSOutput100
pIDTSInput
IDTSInput100
Atributos

Ejemplos

En el ejemplo de código siguiente se muestra cómo crear una nueva ruta de acceso y establecer la ruta de acceso entre dos componentes.

C#
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();  
        srcWrp.ProvideComponentProperties();  

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

        // 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();  
        wrp.ProvideComponentProperties();  

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

Comentarios

Además de establecer el flujo de datos entre y una IDTSOutput100IDTSInput100 entrada, este método también notifica a cada componente del evento llamando a los OnInputPathAttached métodos y OnOutputPathAttached del componente.

Se aplica a

Producto Versiones
SQL Server .NET SDK 2016, 2017, 2019