次の方法で共有


IDTSPath100.AttachPathAndPropagateNotifications メソッド

2 つのコンポーネント間のパスを確立し、影響を受けるコンポーネントに通知します。

名前空間:  Microsoft.SqlServer.Dts.Pipeline.Wrapper
アセンブリ:  Microsoft.SqlServer.DTSPipelineWrap (Microsoft.SqlServer.DTSPipelineWrap.dll)

構文

'宣言
Sub AttachPathAndPropagateNotifications ( _
    pIDTSOutput As IDTSOutput100, _
    pIDTSInput As IDTSInput100 _
)
'使用
Dim instance As IDTSPath100 
Dim pIDTSOutput As IDTSOutput100 
Dim pIDTSInput As IDTSInput100

instance.AttachPathAndPropagateNotifications(pIDTSOutput, _
    pIDTSInput)
void AttachPathAndPropagateNotifications(
    IDTSOutput100 pIDTSOutput,
    IDTSInput100 pIDTSInput
)
void AttachPathAndPropagateNotifications(
    [InAttribute] IDTSOutput100^ pIDTSOutput, 
    [InAttribute] IDTSInput100^ pIDTSInput
)
abstract AttachPathAndPropagateNotifications : 
        pIDTSOutput:IDTSOutput100 * 
        pIDTSInput:IDTSInput100 -> unit
function AttachPathAndPropagateNotifications(
    pIDTSOutput : IDTSOutput100, 
    pIDTSInput : IDTSInput100
)

パラメーター

説明

このメソッドは、IDTSOutput100 出力と IDTSInput100 入力の間のデータのフローの確立に加え、コンポーネントの OnInputPathAttached メソッドと OnOutputPathAttached メソッドを呼び出すことによって、各コンポーネントに対してイベントの通知も行います。

使用例

次のコード例では、新しいパスを作成し、2 つのコンポーネント間にパスを確立しています。

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.");
}
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("DTS.Pipeline", 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

関連項目

参照

IDTSPath100 インターフェイス

Microsoft.SqlServer.Dts.Pipeline.Wrapper 名前空間