次の方法で共有


IDTSPath90.AttachPathAndPropagateNotifications Method

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

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

構文

'宣言
<DispIdAttribute(104)> _
Sub AttachPathAndPropagateNotifications ( _
    <InAttribute> pIDTSOutput As IDTSOutput90, _
    <InAttribute> pIDTSInput As IDTSInput90 _
)
[DispIdAttribute(104)] 
void AttachPathAndPropagateNotifications (
    [InAttribute] IDTSOutput90 pIDTSOutput,
    [InAttribute] IDTSInput90 pIDTSInput
)
[DispIdAttribute(104)] 
void AttachPathAndPropagateNotifications (
    [InAttribute] IDTSOutput90^ pIDTSOutput, 
    [InAttribute] IDTSInput90^ pIDTSInput
)
/** @attribute DispIdAttribute(104) */ 
void AttachPathAndPropagateNotifications (
    /** @attribute InAttribute() */ IDTSOutput90 pIDTSOutput, 
    /** @attribute InAttribute() */ IDTSInput90 pIDTSInput
)
DispIdAttribute(104) 
function AttachPathAndPropagateNotifications (
    pIDTSOutput : IDTSOutput90, 
    pIDTSInput : IDTSInput90
)

パラメータ

  • pIDTSOutput
    上流コンポーネントの出力です。
  • pIDTSInput
    下流コンポーネントの入力です。

解説

IDTSOutput90 出力と IDTSInput90 入力の間のデータのフローの確立に加え、このメソッドは、コンポーネントの 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.
        IDTSComponentMetaData90 md = AddComponentToDataFlow( m , "DTSAdapter.OLEDBSource");
        IDTSComponentMetaData90 oledbSrc = m.ComponentMetaDataCollection.New();
        CManagedComponentWrapper90 srcWrp = oledbSrc.Instantiate();
        srcWrp.ProvideComponentProperties();

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

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

}
public IDTSComponentMetaData90 AddComponentToDataFlow( MainPipe mp , string Component )
{
    if( mp != null )
    {
        IDTSComponentMetaData90 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 IDTSComponentMetaData90 = AddComponentToDataFlow(m, "DTSAdapter.OLEDBSource") 
 Dim oledbSrc As IDTSComponentMetaData90 = m.ComponentMetaDataCollection.New 
 Dim srcWrp As CManagedComponentWrapper90 = oledbSrc.Instantiate 
 srcWrp.ProvideComponentProperties 
 Dim oledbDest As IDTSComponentMetaData90 = AddComponentToDataFlow(m, "DTSAdapter.OLEDBDestination") 
 Dim destWrp As IDTSComponentMetaData90 = oledbDest.ComponentMetaDataCollection.New 
 Dim destWrp As CManagedComponentWrapper90 = md.Instantiate 
 destWrp.ProvideComponentProperties 
 Dim path As IDTSPath90 = 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 IDTSComponentMetaData90 
 If Not (mp Is Nothing) Then 
   Dim md As IDTSComponentMetaData90 = 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

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

IDTSPath90 Interface
IDTSPath90 Members
Microsoft.SqlServer.Dts.Pipeline.Wrapper Namespace