ConnectionManager.Properties 속성

정의

ConnectionManager에 대한 속성 개체의 컬렉션을 가져옵니다. 이는 연결 관리자에서 호스팅하는 특정 연결의 속성에 액세스하는 메서드입니다. 이 속성은 읽기 전용입니다.

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

속성 값

해당 연결 유형과 관련된 속성이 포함된 DtsProperties 컬렉션입니다.

구현

예제

다음 코드 예제에서는 컬렉션의 Properties 인덱스 구문을 [0]사용 하 여 컬렉션의 Connections 첫 번째 연결 관리자에서 컬렉션을 가져옵니다. 그런 다음 샘플은 컬렉션에 있는 Properties 속성의 이름을 씁니다.

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

namespace ConnMgr_Properties_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 Properties collection from the connection  
            // manager and iterate through the properties,   
            // printing the property names.  
            ConnectionManager myConnMgr = myConns[0];  
            DtsProperties connProperties = myConnMgr.Properties;  

            foreach (DtsProperty connProp in connProperties)  
                Console.WriteLine(connProp.Name);  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace ConnMgr_Properties_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 Properties collection from the connection  
            ' manager and iterate through the properties,   
            ' printing the property names.  
            Dim myConnMgr As ConnectionManager =  myConns(0)   
            Dim connProperties As DtsProperties =  myConnMgr.Properties   

            Dim connProp As DtsProperty  
            For Each connProp In connProperties  
                Console.WriteLine(connProp.Name)  
            Next  
        End Sub  
    End Class  
End Namespace  

샘플 출력:

ConnectionString

CreationName

설명

ID

InitialCatalog

속성

암호

ProtectionLevel

RetainSameConnection

ServerName

SupportsDTCTransactions

UserName

설명

ConnectionManager에서 상속된 모든 클래스는 동일한 속성 및 메서드를 포함합니다. 그러나 각 연결 유형에는 해당 연결 유형과 관련된 추가 속성이 있습니다. 컬렉션에서 연결 관리자를 가져오고 속성을 반복하는 경우 클래스에서 ConnectionManager 찾을 수 없는 모든 속성은 해당 연결과 관련된 속성입니다. 연결에 고유하지만 일부 속성 ConnectionManager(예: RetainSameConnection 여러 연결에 있는 속성)을 설정하려면 다음 코드 줄을 사용합니다.

ConnectionManager.Properties("RetainSameConnection") = True

사용 가능한 연결 유형에 대한 자세한 내용은 Integration Services(SSIS) 연결을 참조하세요.

적용 대상