Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mengonfigurasi properti dan kumpulan kolom komponen.
public interface class CManagedComponentWrapper : Microsoft::SqlServer::Dts::Pipeline::Wrapper::IDTSDesigntimeComponent100
[System.Runtime.InteropServices.CoClass(typeof(Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass))]
[System.Runtime.InteropServices.Guid("B7EBC995-699A-4067-A34C-40FAF745C987")]
public interface CManagedComponentWrapper : Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSDesigntimeComponent100
[System.Runtime.InteropServices.CoClass(typeof(Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass))]
[System.Runtime.InteropServices.Guid("E1ACC72B-14CE-4A91-B45F-E87773C1ABB5")]
public interface CManagedComponentWrapper : Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSDesigntimeComponent100
[System.Runtime.InteropServices.CoClass(typeof(Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass))]
[System.Runtime.InteropServices.Guid("1C0F2743-58D4-4663-9BC0-06B4D19B51A7")]
public interface CManagedComponentWrapper : Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSDesigntimeComponent100
[<System.Runtime.InteropServices.CoClass(typeof(Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass))>]
[<System.Runtime.InteropServices.Guid("B7EBC995-699A-4067-A34C-40FAF745C987")>]
type CManagedComponentWrapper = interface
interface IDTSDesigntimeComponent100
[<System.Runtime.InteropServices.CoClass(typeof(Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass))>]
[<System.Runtime.InteropServices.Guid("E1ACC72B-14CE-4A91-B45F-E87773C1ABB5")>]
type CManagedComponentWrapper = interface
interface IDTSDesigntimeComponent100
[<System.Runtime.InteropServices.CoClass(typeof(Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass))>]
[<System.Runtime.InteropServices.Guid("1C0F2743-58D4-4663-9BC0-06B4D19B51A7")>]
type CManagedComponentWrapper = interface
interface IDTSDesigntimeComponent100
Public Interface CManagedComponentWrapper
Implements IDTSDesigntimeComponent100
Contoh kode berikut menunjukkan cara menambahkan komponen secara terprogram ke tugas aliran data dan membuat instans antarmuka waktu desain.
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.
IDTSComponentMetaData100 metaData = dataFlowTask.ComponentMetaDataCollection.New();
// Set the class id of the component.
metaData.ComponentClassID = "";
// Create an instance of the component.
CManagedComponentWrapper wrapper = metaData.Instantiate();
// Initialize the component by calling ProvideComponentProperties.
wrapper.ProvideComponentProperties();
}
}
}
}
Keterangan
CManagedComponentWrapper mewakili antarmuka IDTSDesigntimeComponent100 yang digunakan dalam modifikasi waktu desain komponen aliran data.
CManagedComponentWrapper digunakan untuk mengonfigurasi properti dan kumpulan kolom komponen aliran data selama waktu desain. Meskipun metadata komponen dapat dimodifikasi secara langsung, ini harus dihindari karena melakukannya melewati kemampuan komponen untuk memvalidasi modifikasi pada metadatanya. Instans CManagedComponentWrapper dibuat dengan memanggil Instantiate metode antarmuka komponen IDTSComponentMetaData100 .