次の方法で共有


IDTSComponentMetaData100.Instantiate メソッド

ComponentClassID プロパティで指定されたコンポーネントのインスタンスを作成します。

名前空間:  Microsoft.SqlServer.Dts.Pipeline.Wrapper
アセンブリ:  Microsoft.SqlServer.DTSPipelineWrap (Microsoft.SqlServer.DTSPipelineWrap.dll)

構文

'宣言
Function Instantiate As CManagedComponentWrapper
'使用
Dim instance As IDTSComponentMetaData100 
Dim returnValue As CManagedComponentWrapper 

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

戻り値

型: Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapper
コンポーネントの CManagedComponentWrapper クラスです。

説明

このメソッドが呼び出されると、ComponentClassID プロパティによって定義されたコンポーネントのデザイン時インスタンスが作成されます。 コンポーネントのメタデータを編集し構成するために、コンポーネントのデザイン時インスタンスが作成されます。 コンポーネントを編集する場合は、コンポーネント メタデータに直接アクセスするのではなく、デザイン時インスタンスを使用して、コンポーネントがメタデータの変更を監視および検証できるようにしてください。

使用例

次のコード サンプルでは、コンポーネントのデザイン時インスタンスを使用して、コンポーネントのカスタム プロパティを設定します。 この例では、コンポーネント メタデータの 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")

関連項目

参照

IDTSComponentMetaData100 インターフェイス

Microsoft.SqlServer.Dts.Pipeline.Wrapper 名前空間