Partager via


Méthode IDTSComponentMetaData100.Instantiate

Creates an instance of a component specified by the ComponentClassID property.

Espace de noms :  Microsoft.SqlServer.Dts.Pipeline.Wrapper
Assembly :  Microsoft.SqlServer.DTSPipelineWrap (en Microsoft.SqlServer.DTSPipelineWrap.dll)

Syntaxe

'Déclaration
Function Instantiate As CManagedComponentWrapper
'Utilisation
Dim instance As IDTSComponentMetaData100 
Dim returnValue As CManagedComponentWrapper 

returnValue = instance.Instantiate()
CManagedComponentWrapper Instantiate()
CManagedComponentWrapper^ Instantiate()
abstract Instantiate : unit -> CManagedComponentWrapper
function Instantiate() : CManagedComponentWrapper

Valeur de retour

Type : Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapper
The CManagedComponentWrapper class of the component.

Notes

When this method is called, the design-time instance of the component defined by the ComponentClassID property is created. The design-time instance of the component is created to edit and configure the metadata of a component. The design-time instance should be used for editing a component, instead of directly accessing the component metadata, to allow the component to monitor and validate changes to the metadata.

Exemples

The following code sample shows how the design-time instance of a component is used to set the custom property of a component. In this example, the CustomPropertyCollection of the component metadata could be used to directly set the property, but would bypass the ability of the component to monitor and respond to changes to the property.

IDTSComponentMetaData100 cmp = dataflowTask.ComponentMetaDataCollection.New();
cmp.ComponentClassID = "DTSAdapter.OleDbSource";
CManagedComponentWrapper dtSource = cmp.Instantiate();
dtSource.SetComponentProperty("SqlCommand","select * from Production.Products");
Dim cmp As IDTSComponentMetaData100 = dataflowTask.ComponentMetaDataCollection.New 
cmp.ComponentClassID = "DTSAdapter.OleDbSource" 
Dim dtSource As CManagedComponentWrapper = cmp.Instantiate 
dtSource.SetComponentProperty("SqlCommand", "select * from Production.Products")

Voir aussi

Référence

IDTSComponentMetaData100 Interface

Espace de noms Microsoft.SqlServer.Dts.Pipeline.Wrapper