Package.Connections 속성

정의

패키지의 연결 관리자 모음을 받아옵니다.

public:
 property Microsoft::SqlServer::Dts::Runtime::Connections ^ Connections { Microsoft::SqlServer::Dts::Runtime::Connections ^ get(); };
public Microsoft.SqlServer.Dts.Runtime.Connections Connections { get; }
member this.Connections : Microsoft.SqlServer.Dts.Runtime.Connections
Public ReadOnly Property Connections As Connections

속성 값

패키지의 연결 관리자 모음입니다.

예제

다음 예시는 UsingExecuteProcess 패키지 샘플을 로드한 후, 패키지가 사용하는 연결들을 검색하고 연결에 관한 몇 가지 속성을 보여줍니다.

static void Main(string[] args)  
        {  
            // The variable pkg points to the location  
            // of the ExecuteProcess package sample   
            // that is installed with the samples.  
            string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";  

            Application app = new Application();  
            Package p = app.LoadPackage(pkg, null);  
            Connections conns = p.Connections;  
            foreach (ConnectionManager cm in conns)  
                Console.WriteLine("Name = " + cm.CreationName + ", HostType = " + cm.HostType);  
        }  
Shared  Sub Main(ByVal args() As String)  
            ' The variable pkg points to the location  
            ' of the ExecuteProcess package sample   
            ' that is installed with the samples.  
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx"   

            Dim app As Application =  New Application()   
            Dim p As Package =  app.LoadPackage(pkg,Nothing)   
            Dim conns As Connections =  p.Connections   
            Dim cm As ConnectionManager  
            For Each cm In conns  
                Console.WriteLine("Name = " + cm.CreationName + ", HostType = " + cm.HostType)  
            Next  
End Sub  

샘플 출력:

Name = FILE, HostType = ConnectionManager

Name = OLEDB, HostType = ConnectionManager

Name = OLEDB, HostType = ConnectionManager

설명

연결 관리자는 작업 수행에 기본 데이터 저장소와 연결되는 일반적인 인터페이스를 제공하여 작업 구현을 단순화할 수 있게 합니다. 객체의 ConnectionManager 메서드를 사용하여 AcquireConnection 컬렉션 내 연결 관리자 객체 중 어느 곳에서든 필요한 연결 정보를 가져오세요.

연결 관리자는 GUID나 이름으로 참조할 수 있으며, 연결 관리자 이름은 구성 파일에 저장할 수 있습니다. 연결을 이름으로 참조하려면 \Package.Connections[{9930DA64-A413-4286-9C66-74EDADB4F393}].ConnectionString 대신 를 사용\Package.Connections[myConnection].ConnectionString하세요.

연결 및 연결 관리자에 대한 자세한 내용은 통합 서비스(SSIS) 연결을 참조하세요.

적용 대상