IDTSComponentMetaDataCollection100.New Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
public:
Microsoft::SqlServer::Dts::Pipeline::Wrapper::Sql2014::IDTSComponentMetaData100 ^ New();
[System.Runtime.InteropServices.DispId(14)]
public Microsoft.SqlServer.Dts.Pipeline.Wrapper.Sql2014.IDTSComponentMetaData100 New ();
[<System.Runtime.InteropServices.DispId(14)>]
abstract member New : unit -> Microsoft.SqlServer.Dts.Pipeline.Wrapper.Sql2014.IDTSComponentMetaData100
Public Function New () As IDTSComponentMetaData100
Retornos
O objeto IDTSComponentMetaData100 recém-criado.
- Atributos
Exemplos
O exemplo de código a seguir adiciona um componente OLE DB Source a uma tarefa de fluxo de dados chamando o novo método da MainPipe classe.
using System;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper.Sql2014;
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();
}
}
}
}
See Also
IDTSComponentMetaDataCollection100 Interface
Microsoft.SqlServer.Dts.Pipeline.Wrapper Namespace
Return to top
Comentários
Os componentes de fluxo de dados são adicionados à MainPipe classe chamando o método New do ComponentMetaDataCollection.