다음을 통해 공유


IDTSComponentMetaData90.GetComponentView Method

Gets the IDTSComponentView90 interface for a component, which supports transactional edits of the component metadata.

네임스페이스: Microsoft.SqlServer.Dts.Pipeline.Wrapper
어셈블리: Microsoft.SqlServer.DTSPipelineWrap (in microsoft.sqlserver.dtspipelinewrap.dll)

구문

‘선언
<DispIdAttribute(119)> _
Function GetComponentView As IDTSComponentView90
[DispIdAttribute(119)] 
IDTSComponentView90 GetComponentView ()
[DispIdAttribute(119)] 
IDTSComponentView90^ GetComponentView ()
/** @attribute DispIdAttribute(119) */ 
IDTSComponentView90 GetComponentView ()
DispIdAttribute(119) 
function GetComponentView () : IDTSComponentView90

반환 값

The IDTSComponentView90 interface of the component.

주의

This method is called to retrieve the IDTSComponentView90 interface of the component. This interface allows transactional modifications to be made to the component metadata. The component metadata modifications are persisted when the Commit method is called, and reverted when the Cancel method is called.

The following code example demonstrates how the GetComponentView method is used.

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.
            IDTSComponentMetaData90 mdOleDbSrc = mp.ComponentMetaDataCollection.New();
            mdOleDbSrc.ComponentClassID = "DTSAdapter.OleDbSource";
            mdOleDbSrc.Name = "OLEDB Source";

            IDTSComponentView90 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 IDTSComponentMetaData90 = mp.ComponentMetaDataCollection.New 
     mdOleDbSrc.ComponentClassID = "DTSAdapter.OleDbSource" 
     mdOleDbSrc.Name = "OLEDB Source" 
     Dim oledbView As IDTSComponentView90 = mdOleDbSrc.GetComponentView 
     mdOleDbSrc.Name = "The OLEDB Source Component" 
     Console.WriteLine(mdOleDbSrc.Name) 
     oledbView.Cancel 
     Console.WriteLine(mdOleDbSrc.Name) 
   End Sub 
 End Class 
End Namespace

The following output is generated by the above code example.

The OLEDB Source Component

OLEDB Source

스레드 보안

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.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

IDTSComponentMetaData90 Interface
IDTSComponentMetaData90 Members
Microsoft.SqlServer.Dts.Pipeline.Wrapper Namespace