IDTSComponentMetaData100.GetComponentView Metode
Definisi
Penting
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.
IDTSComponentView100 Mendapatkan antarmuka untuk komponen, yang mendukung pengeditan transaksi dari metadata komponen.
public:
Microsoft::SqlServer::Dts::Pipeline::Wrapper::IDTSComponentView100 ^ GetComponentView();
[System.Runtime.InteropServices.DispId(119)]
public Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentView100 GetComponentView ();
[<System.Runtime.InteropServices.DispId(119)>]
abstract member GetComponentView : unit -> Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentView100
Public Function GetComponentView () As IDTSComponentView100
Mengembalikan
Antarmuka IDTSComponentView100 komponen.
- Atribut
Contoh
Contoh kode berikut menunjukkan bagaimana GetComponentView metode digunakan.
using System;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
namespace Microsoft.Samples.SqlServer.Dts
{
public class Class1
{
public static void Main(string []args)
{
// Create the package.
Package p = new Package();
// Add the data flow task.
MainPipe mp = ((TaskHost)p.Executables.Add("DTS.Pipeline")).InnerObject as MainPipe;
// Add the OLEDB Source component.
IDTSComponentMetaData100 mdOleDbSrc = mp.ComponentMetaDataCollection.New();
mdOleDbSrc.ComponentClassID = "DTSAdapter.OleDbSource";
mdOleDbSrc.Name = "OLEDB Source";
IDTSComponentView100 oledbView = mdOleDbSrc.GetComponentView();
mdOleDbSrc.Name = "The OLEDB Source Component";
Console.WriteLine(mdOleDbSrc.Name);
oledbView.Cancel();
Console.WriteLine(mdOleDbSrc.Name);
}
}
}
Imports System
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Namespace Microsoft.Samples.SqlServer.Dts
Public Class Class1
Public Shared Sub Main(ByVal args As String())
Dim p As Package = New Package
Dim mp As MainPipe = CType(CType(p.Executables.Add("DTS.Pipeline").InnerObject, TaskHost), MainPipe)
Dim mdOleDbSrc As IDTSComponentMetaData100 = mp.ComponentMetaDataCollection.New
mdOleDbSrc.ComponentClassID = "DTSAdapter.OleDbSource"
mdOleDbSrc.Name = "OLEDB Source"
Dim oledbView As IDTSComponentView100 = mdOleDbSrc.GetComponentView
mdOleDbSrc.Name = "The OLEDB Source Component"
Console.WriteLine(mdOleDbSrc.Name)
oledbView.Cancel
Console.WriteLine(mdOleDbSrc.Name)
End Sub
End Class
End Namespace
Output berikut dihasilkan oleh contoh kode di atas.
Komponen Sumber OLEDB
Sumber OLEDB
Keterangan
Metode ini dipanggil untuk mengambil IDTSComponentView100 antarmuka komponen. Antarmuka ini memungkinkan modifikasi transaksional dilakukan pada metadata komponen. Modifikasi metadata komponen dipertahankan ketika Commit metode dipanggil, dan dikembalikan ketika metode dipanggil Cancel .