IDTSComponentMetaDataCollection100.New Method
Creates a new IDTSComponentMetaData100 object and adds it to an IDTSComponentMetaDataCollection100 collection.
Namespace: Microsoft.SqlServer.Dts.Pipeline.Wrapper
Assembly: Microsoft.SqlServer.DTSPipelineWrap (in microsoft.sqlserver.dtspipelinewrap.dll)
Syntax
'Deklaracja
<DispIdAttribute(14)> _
Function New As IDTSComponentMetaData100
[DispIdAttribute(14)]
IDTSComponentMetaData100 New ()
[DispIdAttribute(14)]
IDTSComponentMetaData100^ New ()
/** @attribute DispIdAttribute(14) */
IDTSComponentMetaData100 New ()
DispIdAttribute(14)
function New () : IDTSComponentMetaData100
Return Value
The newly created IDTSComponentMetaData100 object.
Remarks
Data flow components are added to the MainPipe class by calling the New method of the ComponentMetaDataCollection.
Example
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("SSIS.Pipeline.2")).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();
}
}
}
}
Thread Safety
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.
Platforms
Development Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.
Target Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.