IDTSComponentMetaDataCollection100.New Método

Definición

Crea un nuevo objeto IDTSComponentMetaData100 y lo agrega a una colección IDTSComponentMetaDataCollection100.

public:
 Microsoft::SqlServer::Dts::Pipeline::Wrapper::IDTSComponentMetaData100 ^ New();
[System.Runtime.InteropServices.DispId(14)]
public Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100 New ();
[<System.Runtime.InteropServices.DispId(14)>]
abstract member New : unit -> Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100
Public Function New () As IDTSComponentMetaData100

Devoluciones

Objeto IDTSComponentMetaData100 recién creado.

Atributos

Ejemplos

En el ejemplo de código siguiente se agrega un componente de origen OLE DB a una tarea de flujo de datos llamando al New método de la MainPipe clase .

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

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

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

            if (dataFlowTask != null)  
            {  
                // Add a component to the data flow task.  
                IDTSComponentMetaData100 metaData = dataFlowTask.ComponentMetaDataCollection.New();  

                // Set the class ID of the component.  
                metaData.ComponentClassID = "DTSAdapter.OLEDBSource.1";  

                // Create an instance of the component.  
                CManagedComponentWrapper wrapper = metaData.Instantiate();  

                // Initialize the component.  
                wrapper.ProvideComponentProperties();  
            }  
        }  
    }  
}  

Comentarios

Los componentes de flujo de datos se agregan a la MainPipe clase llamando al New método de ComponentMetaDataCollection.

Se aplica a