Compartir a través de


MainPipeClass Class

Adds and connects components in a data flow layout.

Espacio de nombres: Microsoft.SqlServer.Dts.Pipeline.Wrapper
Ensamblado: Microsoft.SqlServer.DTSPipelineWrap (in microsoft.sqlserver.dtspipelinewrap.dll)

Sintaxis

'Declaración
<ClassInterfaceAttribute(0)> _
<GuidAttribute("C3BF9DC1-4715-4694-936F-D3CFDA9E42C5")> _
<TypeLibTypeAttribute(2)> _
Public Class MainPipeClass
    Implements IDTSPipeline90, MainPipe, IDTSObjectModel90
[ClassInterfaceAttribute(0)] 
[GuidAttribute("C3BF9DC1-4715-4694-936F-D3CFDA9E42C5")] 
[TypeLibTypeAttribute(2)] 
public class MainPipeClass : IDTSPipeline90, MainPipe, IDTSObjectModel90
[ClassInterfaceAttribute(0)] 
[GuidAttribute(L"C3BF9DC1-4715-4694-936F-D3CFDA9E42C5")] 
[TypeLibTypeAttribute(2)] 
public ref class MainPipeClass : IDTSPipeline90, MainPipe, IDTSObjectModel90
/** @attribute ClassInterfaceAttribute(0) */ 
/** @attribute GuidAttribute("C3BF9DC1-4715-4694-936F-D3CFDA9E42C5") */ 
/** @attribute TypeLibTypeAttribute(2) */ 
public class MainPipeClass implements IDTSPipeline90, MainPipe, 
    IDTSObjectModel90
ClassInterfaceAttribute(0) 
GuidAttribute("C3BF9DC1-4715-4694-936F-D3CFDA9E42C5") 
TypeLibTypeAttribute(2) 
public class MainPipeClass implements IDTSPipeline90, MainPipe, 
    IDTSObjectModel90

Notas

This class represents the data flow task, and is used when programmatically building a data flow layout. An instance of the class is created by adding the data flow task to the Executables collection of a Package. Components are added to the task using the ComponentMetaDataCollection property. Connections are established between components using the PathCollection property.

Inheritance Hierarchy

System.Object
  Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipeClass

Ejemplo

The following code example adds a data flow task to a package, adds an OLE DB source component and an OLE DB destination component, and establishes a path between the two components.

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

namespace Microsoft.Samples.SqlServer.Dts
{
    public class Class1
    {
        public static void Main(string []args)
        {
            // Create the package.
            Package p = new Package();

            // Add the data flow task.
            MainPipe mp = ((TaskHost)p.Executables.Add("DTS.Pipeline")).InnerObject as MainPipe;

            // Add the OLE DB source component.
            IDTSComponentMetaData90 mdOleDbSrc = mp.ComponentMetaDataCollection.New();
            mdOleDbSrc.ComponentClassID = "DTSAdapter.OleDbSource";
            mdOleDbSrc.Name = "OLEDB Source";
            CManagedComponentWrapper wrpOledbSrc = mdOleDbSrc.Instantiate();

            // Add the OLE DB destination component.
            IDTSComponentMetaData90 mdOleDbDest = mp.ComponentMetaDataCollection.New();
            mdOleDbDest.ComponentClassID = "DTSAdapter.OleDbDestination";
            mdOleDbDest.Name = "OLEDB Destination";
            CManagedComponentWrapper wrpOledbDest = mdOleDbSrc.Instantiate();

            // Create a path and attach the output of the source to the input of the destination.
            IDTSPath90 path = mp.PathCollection.New();
            path.AttachPathAndPropagateNotifications(mdOleDbSrc.OutputCollection[0], mdOleDbDest.InputCollection[0]);
        }
    }
}
Imports System 
Imports Microsoft.SqlServer.Dts.Runtime 
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper 
Namespace Microsoft.Samples.SqlServer.Dts 

 Public Class Class1 

   Public Shared Sub Main(ByVal args As String()) 
     Dim p As Package = New Package 
     Dim mp As MainPipe = CType(CType(p.Executables.Add("DTS.Pipeline"), TaskHost).InnerObject, MainPipe) 
     Dim mdOleDbSrc As IDTSComponentMetaData90 = mp.ComponentMetaDataCollection.New 
     mdOleDbSrc.ComponentClassID = "DTSAdapter.OleDbSource" 
     mdOleDbSrc.Name = "OLEDB Source" 
     Dim wrpOledbSrc As CManagedComponentWrapper = mdOleDbSrc.Instantiate 
     Dim mdOleDbDest As IDTSComponentMetaData90 = mp.ComponentMetaDataCollection.New 
     mdOleDbDest.ComponentClassID = "DTSAdapter.OleDbDestination" 
     mdOleDbDest.Name = "OLEDB Destination" 
     Dim wrpOledbDest As CManagedComponentWrapper = mdOleDbSrc.Instantiate 
     Dim path As IDTSPath90 = mp.PathCollection.New 
     path.AttachPathAndPropagateNotifications(mdOleDbSrc.OutputCollection(0), mdOleDbDest.InputCollection(0)) 
   End Sub 
 End Class 
End Namespace

Seguridad para subprocesos

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.

Plataformas

Plataformas de desarrollo

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Plataformas de destino

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Vea también

Referencia

MainPipeClass Members
Microsoft.SqlServer.Dts.Pipeline.Wrapper Namespace