IDTSComponentMetaDataCollection100.New Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
public:
Microsoft::SqlServer::Dts::Pipeline::Wrapper::Sql2012::IDTSComponentMetaData100 ^ New();
[System.Runtime.InteropServices.DispId(14)]
public Microsoft.SqlServer.Dts.Pipeline.Wrapper.Sql2012.IDTSComponentMetaData100 New ();
[<System.Runtime.InteropServices.DispId(14)>]
abstract member New : unit -> Microsoft.SqlServer.Dts.Pipeline.Wrapper.Sql2012.IDTSComponentMetaData100
Public Function New () As IDTSComponentMetaData100
Retours
Objet IDTSComponentMetaData100 nouvellement créé.
- Attributs
Exemples
L’exemple de code suivant ajoute un composant Source OLE DB à une tâche de flux de données en appelant la méthode New de la classe MainPipe.
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();
}
}
}
}
Remarques
Les composants de flux de données sont ajoutés à la classe MainPipe en appelant la méthode New de ComponentMetaDataCollection.