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)
Syntax
'Deklaracja
<DispIdAttribute(104)> _
Sub AttachPathAndPropagateNotifications ( _
<InAttribute> pIDTSOutput As IDTSOutput100, _
<InAttribute> pIDTSInput As IDTSInput100 _
)
[DispIdAttribute(104)]
void AttachPathAndPropagateNotifications (
[InAttribute] IDTSOutput100 pIDTSOutput,
[InAttribute] IDTSInput100 pIDTSInput
)
[DispIdAttribute(104)]
void AttachPathAndPropagateNotifications (
[InAttribute] IDTSOutput100^ pIDTSOutput,
[InAttribute] IDTSInput100^ pIDTSInput
)
/** @attribute DispIdAttribute(104) */
void AttachPathAndPropagateNotifications (
/** @attribute InAttribute() */ IDTSOutput100 pIDTSOutput,
/** @attribute InAttribute() */ IDTSInput100 pIDTSInput
)
DispIdAttribute(104)
function AttachPathAndPropagateNotifications (
pIDTSOutput : IDTSOutput100,
pIDTSInput : IDTSInput100
)
Parameters
- pIDTSOutput
The output of the upstream component.
- pIDTSInput
The input of the downstream component.
Remarks
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.
Example
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("SSIS.Pipeline.2",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.");
}
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime
...
Public Shared Sub main(ByVal args As String())
Dim p As Package = New Package
Dim th As TaskHost = CType(ConversionHelpers.AsWorkaround(p.Executables.Add("SSIS.Pipeline.2", Nothing), GetType(TaskHost)), TaskHost)
Dim m As MainPipe = CType(ConversionHelpers.AsWorkaround(th.InnerObject, GetType(MainPipe)), MainPipe)
Dim md As IDTSComponentMetaData100 = AddComponentToDataFlow(m, "DTSAdapter.OLEDBSource")
Dim oledbSrc As IDTSComponentMetaData100 = m.ComponentMetaDataCollection.New
Dim srcWrp As CManagedComponentWrapper100 = oledbSrc.Instantiate
srcWrp.ProvideComponentProperties
Dim oledbDest As IDTSComponentMetaData100 = AddComponentToDataFlow(m, "DTSAdapter.OLEDBDestination")
Dim destWrp As IDTSComponentMetaData100 = oledbDest.ComponentMetaDataCollection.New
Dim destWrp As CManagedComponentWrapper100 = md.Instantiate
destWrp.ProvideComponentProperties
Dim path As IDTSPath100 = m.PathCollection.New
path.AttachPathAndPropagateNotifications(oledbSrc.OutputCollection(0), oledbDest.InputCollection(0))
End Sub
Public Function AddComponentToDataFlow(ByVal mp As MainPipe, ByVal Component As String) As IDTSComponentMetaData100
If Not (mp Is Nothing) Then
Dim md As IDTSComponentMetaData100 = mp.ComponentMetaDataCollection.New
md.ComponentClassID = Component
Dim wrp As CManagedComponentWrapper = md.Instantiate
wrp.ProvideComponentProperties
Return md
End If
Throw New Exception("DataFlow task does not exist.")
End Function
Thread Safety
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.
Platforms
Development Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.
Target Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.