IDTSComponentMetaData100.Instantiate 方法  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建由 ComponentClassID 属性指定的组件的实例。
public:
 Microsoft::SqlServer::Dts::Pipeline::Wrapper::CManagedComponentWrapper ^ Instantiate();[System.Runtime.InteropServices.DispId(104)]
public Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapper Instantiate ();[<System.Runtime.InteropServices.DispId(104)>]
abstract member Instantiate : unit -> Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperPublic Function Instantiate () As CManagedComponentWrapper返回
组件的 CManagedComponentWrapper 类。
- 属性
示例
下面的代码示例演示如何使用组件的设计时实例来设置组件的自定义属性。 在此示例中, CustomPropertyCollection 组件元数据可用于直接设置属性,但会绕过组件监视和响应属性更改的能力。
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")  
注解
调用此方法时,将创建由属性定义的 ComponentClassID 组件的设计时实例。 创建组件的设计时实例以编辑和配置组件的元数据。 设计时实例应用于编辑组件,而不是直接访问组件元数据,以允许组件监视和验证对元数据的更改。