IDTSComponentMetaData100.GetComponentView 메서드

정의

컴포넌트 메타데이터의 트랜잭션 편집을 지원하는 컴포넌트 인터페이스를 제공합니다 IDTSComponentView100 .

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

반품

구성 요소의 인터페이스입니다 IDTSComponentView100 .

특성

예제

다음 코드 예시는 이 GetComponentView 메서드가 어떻게 사용되는지 보여줍니다.

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  

다음 출력은 위 코드 예시에서 생성됩니다.

OLEDB 소스 구성 요소

OLEDB 원본

설명

이 메서드는 컴포넌트의 인터페이스를 검색 IDTSComponentView100 하기 위해 호출됩니다. 이 인터페이스는 컴포넌트 메타데이터에 대해 트랜잭션 변경을 가능하게 합니다. 구성 요소 메타데이터 수정은 메서드가 Commit 호출될 때 유지되고, 메서드가 Cancel 호출될 때 되돌립니다.

적용 대상