Program aracılığıyla veri akışı bileşenleri bağlama

Veri akışı görev için bileşenleri ekledikten sonra hedefe dönüşümleri ile kaynaklardan veri akışını gösteren bir yürütme ağacı oluşturmak için bunları bağlayın. Kullandığınız IDTSPath100veri akışı bileşenleri bağlamak için nesneler.

Bir yol oluşturma

Arama Newyöntemi PathCollectionözelliği MainPipeyeni bir yol oluşturmak ve veri akışı görev yollar koleksiyonuna eklemek için arayüz. Bu yöntem, yeni bir döndürür, bağlantısı kesilen IDTSPath100sonra iki bileşen bağlanmak için kullandığınız nesnesi.

Arama AttachPathAndPropagateNotificationsyöntemi yolunu bağlanmak ve onlar bağlı yola katılan bileşenlerin bildirmek için. Bu yöntemi kabul eden bir IDTSOutput100ters yönde bileşen ve bir IDTSInput100parametre olarak aşağı akım bileşeni. Varsayılan olarak, bileşen çağrısı ProvideComponentPropertiesyöntemi, girdi olan bileşenleri için tek bir giriş ve çıkışları olan bileşenleri için tek bir çıkış oluşturur. Aşağıdaki örnek, bu varsayılan çıkış kaynağı ve hedef girişi kullanır.

Sonraki Adım

İki bileşenler arasındaki yolu kurduktan sonra bir sonraki konuda anlatıldığı, aşağı akım bileşeni giriş sütunları eşleştirmek için sonraki adıma olur Program aracılığıyla giriş sütunları seçme.

Örnek

Aşağıdaki kod örneği, iki bileşenler arasındaki yolu kurmak gösterilmiştir.

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

namespace Microsoft.SqlServer.Dts.Samples
{
  class Program
  {
    static void Main(string[] args)
    {
      Package package = new Package();
      Executable e = package.Executables.Add("STOCK:PipelineTask");
      TaskHost thMainPipe = e as TaskHost;
      MainPipe dataFlowTask = thMainPipe.InnerObject as MainPipe;

      // Create the source component.  
      IDTSComponentMetaData100 source =
        dataFlowTask.ComponentMetaDataCollection.New();
      source.ComponentClassID = "DTSAdapter.OleDbSource";
      CManagedComponentWrapper srcDesignTime = source.Instantiate();
      srcDesignTime.ProvideComponentProperties();

      // Create the destination component.
      IDTSComponentMetaData100 destination =
        dataFlowTask.ComponentMetaDataCollection.New();
      destination.ComponentClassID = "DTSAdapter.OleDbDestination";
      CManagedComponentWrapper destDesignTime = destination.Instantiate();
      destDesignTime.ProvideComponentProperties();

      // Create the path.
      IDTSPath100 path = dataFlowTask.PathCollection.New();
      path.AttachPathAndPropagateNotifications(source.OutputCollection[0],
        destination.InputCollection[0]);
    }
  }
using System;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Pipeline;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;

namespace Microsoft.SqlServer.Dts.Samples
{
  class Program
  {
    static void Main(string[] args)
    {
      Package package = new Package();
      Executable e = package.Executables.Add("STOCK:PipelineTask");
      TaskHost thMainPipe = e as TaskHost;
      MainPipe dataFlowTask = thMainPipe.InnerObject as MainPipe;

      // Create the source component.  
      IDTSComponentMetaData100 source =
        dataFlowTask.ComponentMetaDataCollection.New();
      source.ComponentClassID = "DTSAdapter.OleDbSource";
      CManagedComponentWrapper srcDesignTime = source.Instantiate();
      srcDesignTime.ProvideComponentProperties();

      // Create the destination component.
      IDTSComponentMetaData100 destination =
        dataFlowTask.ComponentMetaDataCollection.New();
      destination.ComponentClassID = "DTSAdapter.OleDbDestination";
      CManagedComponentWrapper destDesignTime = destination.Instantiate();
      destDesignTime.ProvideComponentProperties();

      // Create the path.
      IDTSPath100 path = dataFlowTask.PathCollection.New();
      path.AttachPathAndPropagateNotifications(source.OutputCollection[0],
        destination.InputCollection[0]);
    }
  }

}

Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Pipeline
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper

Module Module1

  Sub Main()

    Dim package As Microsoft.SqlServer.Dts.Runtime.Package = _
      New Microsoft.SqlServer.Dts.Runtime.Package()
    Dim e As Executable = package.Executables.Add("STOCK:PipelineTask")
    Dim thMainPipe As Microsoft.SqlServer.Dts.Runtime.TaskHost = _
      CType(e, Microsoft.SqlServer.Dts.Runtime.TaskHost)
    Dim dataFlowTask As MainPipe = CType(thMainPipe.InnerObject, MainPipe)

    ' Create the source component.  
    Dim source As IDTSComponentMetaData100 = _
      dataFlowTask.ComponentMetaDataCollection.New()
    source.ComponentClassID = "DTSAdapter.OleDbSource"
    Dim srcDesignTime As CManagedComponentWrapper = source.Instantiate()
    srcDesignTime.ProvideComponentProperties()

    ' Create the destination component.
    Dim destination As IDTSComponentMetaData100 = _
      dataFlowTask.ComponentMetaDataCollection.New()
    destination.ComponentClassID = "DTSAdapter.OleDbDestination"
    Dim destDesignTime As CManagedComponentWrapper = destination.Instantiate()
    destDesignTime.ProvideComponentProperties()


    ' Create the path.
    Dim path As IDTSPath100 = dataFlowTask.PathCollection.New()
    path.AttachPathAndPropagateNotifications(source.OutputCollection(0), _
      destination.InputCollection(0))

  End Sub

End Module
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Pipeline
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper

Module Module1

  Sub Main()

    Dim package As Microsoft.SqlServer.Dts.Runtime.Package = _
      New Microsoft.SqlServer.Dts.Runtime.Package()
    Dim e As Executable = package.Executables.Add("STOCK:PipelineTask")
    Dim thMainPipe As Microsoft.SqlServer.Dts.Runtime.TaskHost = _
      CType(e, Microsoft.SqlServer.Dts.Runtime.TaskHost)
    Dim dataFlowTask As MainPipe = CType(thMainPipe.InnerObject, MainPipe)

    ' Create the source component.  
    Dim source As IDTSComponentMetaData100 = _
      dataFlowTask.ComponentMetaDataCollection.New()
    source.ComponentClassID = "DTSAdapter.OleDbSource"
    Dim srcDesignTime As CManagedComponentWrapper = source.Instantiate()
    srcDesignTime.ProvideComponentProperties()

    ' Create the destination component.
    Dim destination As IDTSComponentMetaData100 = _
      dataFlowTask.ComponentMetaDataCollection.New()
    destination.ComponentClassID = "DTSAdapter.OleDbDestination"
    Dim destDesignTime As CManagedComponentWrapper = destination.Instantiate()
    destDesignTime.ProvideComponentProperties()


    ' Create the path.
    Dim path As IDTSPath100 = dataFlowTask.PathCollection.New()
    path.AttachPathAndPropagateNotifications(source.OutputCollection(0), _
      destination.InputCollection(0))

  End Sub

End Module
Integration Services simgesi (küçük) Integration Services ile güncel kalın

En son karşıdan yüklemeler, makaleler, örnekler ve Microsoft video yanı sıra topluluk seçili çözümleri için ziyaret Integration ServicesMSDN sayfası:


Bu güncelleştirmelerle ilgili otomatik bildirim almak için, sayfadaki RSS akışlarına abone olun.

Ayrıca bkz.

Kavramlar

Program aracılığıyla giriş sütunları seçme