언어

IDTSPackagePath.GetPackagePath 메서드

정의

패키지 위치까지의 상대 경로를 포함하는 문자열을 반환합니다.

public:
 System::String ^ GetPackagePath();
public string GetPackagePath();
abstract member GetPackagePath : unit -> string
Public Function GetPackagePath () As String

반품

패키지 위치까지의 상대 경로를 포함하는 문자열입니다.

예제

클래스는 ConnectionManager 이 인터페이스에서 계승됩니다. 다음 코드 예시는 이 메서드를 사용하는 GetPackagePath 것을 ConnectionManager 보여줍니다.

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  

namespace Connections_Collection  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
           // The package is one of the SSIS Samples.  
            string mySample = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";  

            // Create an application and load the sample.  
            Application app = new Application();  
            Package pkg = app.LoadPackage(mySample, null);  
            Connections myConns = pkg.Connections;  

            // Get the package path.  
            foreach (ConnectionManager connMgr in myConns)  
            {  
                Console.WriteLine("PackagePath:        {0}", connMgr.GetPackagePath());  
            }  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace Connections_Collection  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
           ' The package is one of the SSIS Samples.  
            Dim mySample As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx"   

            ' Create an application and load the sample.  
            Dim app As Application =  New Application()   
            Dim pkg As Package =  app.LoadPackage(mySample,Nothing)   
            Dim myConns As Connections =  pkg.Connections   

            ' Get the package path.  
            Dim connMgr As ConnectionManager  
            For Each connMgr In myConns  
                Console.WriteLine("PackagePath:        {0}", connMgr.GetPackagePath())  
            Next  
        End Sub  
    End Class  
End Namespace  

샘플 출력:

PackagePath: \Package.Connections[{3427BFE1-F10C-4B7E-8E70-E8D9DC7DDBA3}]

PackagePath: \Package.Connections[{48B66F8D-7DFE-4D85-91C7-0999655484B2}]

설명

이 인터페이스는 컨테이너에 의해 상속됩니다. 통합 서비스 아키텍처에서는 컨테이너가 작업에 구조와 서비스를 제공합니다. 패키지는 일종의 컨테이너입니다. SSIS가 포함하는 다른 컨테이너 유형으로는 For Loop, Foreach Loop, Sequence, 작업 호스트 컨테이너, 이벤트 핸들러가 있습니다. 자세한 내용은 Integration Services(SSIS) 패키지를 참조하세요.

적용 대상