Aracılığıyla paylaş


IDTSComponentMetaData100.GetComponentView Yöntemi

Alır IDTSComponentView100 arabirim bileşen, bileşenin meta veriler işlem düzenlemeleri destekler.

Ad Alanı:  Microsoft.SqlServer.Dts.Pipeline.Wrapper
Derleme:  Microsoft.SqlServer.DTSPipelineWrap (Microsoft.SqlServer.DTSPipelineWrap içinde.dll)

Sözdizimi

'Bildirim
Function GetComponentView As IDTSComponentView100
'Kullanım
Dim instance As IDTSComponentMetaData100
Dim returnValue As IDTSComponentView100

returnValue = instance.GetComponentView()
IDTSComponentView100 GetComponentView()
IDTSComponentView100^ GetComponentView()
abstract GetComponentView : unit -> IDTSComponentView100 
function GetComponentView() : IDTSComponentView100

Açıklamalar

Almak için bu yöntem çaðrýlýr IDTSComponentView100 arabirim bileşeni.Bileşen meta veriler için yapılacak işlem değişiklikler bu arabirim sağlar.Bileşen meta veriler değişiklikleri kalıcı, Commit yöntem olarak adlandırılan ve döndürüldü, Cancel yöntem çağrılır.

Örnekler

Aşağıdaki kod örneği gösterir nasıl GetComponentView kullanılan yöntem.

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("SSIS.Pipeline.2")).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("SSIS.Pipeline.2").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

Yukarıdaki kod örneği tarafından şu çıktı üretilir.

The OLEDB Source Component

OLEDB Source