IDTSComponentMetaDataCollection90.New Method
Creates a new IDTSComponentMetaData90 object and adds it to an IDTSComponentMetaDataCollection90 collection.
命名空間: Microsoft.SqlServer.Dts.Pipeline.Wrapper
組件: Microsoft.SqlServer.DTSPipelineWrap (in microsoft.sqlserver.dtspipelinewrap.dll)
語法
'宣告
<DispIdAttribute(14)> _
Function New As IDTSComponentMetaData90
[DispIdAttribute(14)]
IDTSComponentMetaData90 New ()
[DispIdAttribute(14)]
IDTSComponentMetaData90^ New ()
/** @attribute DispIdAttribute(14) */
IDTSComponentMetaData90 New ()
DispIdAttribute(14)
function New () : IDTSComponentMetaData90
傳回值
The newly created IDTSComponentMetaData90 object.
備註
Data flow components are added to the MainPipe class by calling the New method of the ComponentMetaDataCollection.
範例
The following code example adds an OLE DB Source component to a data flow task by calling the New method of the MainPipe class.
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.
IDTSComponentMetaData90 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();
}
}
}
}
執行緒安全性
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
平台
開發平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
目標平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
請參閱
參考
IDTSComponentMetaDataCollection90 Interface
IDTSComponentMetaDataCollection90 Members
Microsoft.SqlServer.Dts.Pipeline.Wrapper Namespace