IDTSRuntimeConnection100.ConnectionManager 속성

정의

public:
 property Microsoft::SqlServer::Dts::Runtime::Wrapper::Sql2012::IDTSConnectionManager100 ^ ConnectionManager { Microsoft::SqlServer::Dts::Runtime::Wrapper::Sql2012::IDTSConnectionManager100 ^ get(); void set(Microsoft::SqlServer::Dts::Runtime::Wrapper::Sql2012::IDTSConnectionManager100 ^ value); };
[System.Runtime.InteropServices.DispId(102)]
public Microsoft.SqlServer.Dts.Runtime.Wrapper.Sql2012.IDTSConnectionManager100 ConnectionManager { [System.Runtime.InteropServices.DispId(102)] get; [System.Runtime.InteropServices.DispId(102)] set; }
[<System.Runtime.InteropServices.DispId(102)>]
[<get: System.Runtime.InteropServices.DispId(102)>]
[<set: System.Runtime.InteropServices.DispId(102)>]
member this.ConnectionManager : Microsoft.SqlServer.Dts.Runtime.Wrapper.Sql2012.IDTSConnectionManager100 with get, set
Public Property ConnectionManager As IDTSConnectionManager100

속성 값

구성 요소의 IDTSConnectionManager100입니다.

특성

예제

' TODO: Replace the path to the package with a valid path.  
Dim package As String = "c:\Package.dtsx"   

' Create the application and load the package.  
Dim a As Application = New Application   
Dim p As Package = a.LoadPackage(package, Nothing)   

' Walk the Executables collection looking for data flow tasks.  
For Each e As Executable In p.Executables   
 Dim mp As MainPipe = CType(CType(e, TaskHost).InnerObject, MainPipe)   
 If Not (e Is Nothing) Then   
   ' Walk the components.  
   For Each md As IDTSComponentMetaData100 In mp.ComponentMetaDataCollection   
     ' Walk the RuntimeConnectionCollection.  
     For Each rc As IDTSRuntimeConnection100 In md.RuntimeConnectionCollection   
       ' Check to see whether the package's connections collection    
       '  contains the Connectionmanager stored in the RuntimeConnection.  
       If p.Connections.Contains(rc.ConnectionManagerID) Then   
         rc.ConnectionManager = DtsConvert.ToConnectionManager100(p.Connections(rc.ConnectionManagerID))   
       Else   
         Console.WriteLine("The ConnectionManager " + rc.ConnectionManagerID + " was not found in the Package's Connections collection.")   
       End If   
     Next   
   Next   
 End If   
Next  
// TODO: Replace the path to the package with a valid path.  
string package = @"c:\Package.dtsx";  

// Create the application and load the package.  
Application a = new Application();  
Package p = a.LoadPackage( package , null );  

// Walk the Executables collection looking for data flow tasks.  
foreach (Executable e in p.Executables)  
{  
    MainPipe mp = ((TaskHost)e).InnerObject as MainPipe;  
    if( e != null )  
    {  
        // Walk the components.  
        foreach( IDTSComponentMetaData100 md in mp.ComponentMetaDataCollection )  
        {  
            // Walk the RuntimeConnectionCollection.  
            foreach( IDTSRuntimeConnection100 rc in md.RuntimeConnectionCollection )  
            {  
                // Check to see if the package's connections collection contains the   
                // Connectionmanager stored in the RuntimeConnection.  
                if (p.Connections.Contains(rc.ConnectionManagerID))  
                    rc.ConnectionManager = DtsConvert.ToConnectionManager100(p.Connections[rc.ConnectionManagerID]);  
                else  
                    Console.WriteLine("The ConnectionManager " + rc.ConnectionManagerID + " was not found in the Package's Connections collection.");  
            }  
        }  
    }  
}  

설명

ConnectionManager 속성은 패키지에 포함된 개체의 IDTSConnectionManager100 실제 인스턴스에 대한 참조를 포함하거나 설정합니다. 런타임에 이 참조는 속성을 사용하여 ConnectionManagerID SSIS 런타임 엔진에 의해 자동으로 설정되어 패키지에서 연결을 찾고 참조를 할당합니다.

디자인 타임에 SSIS 디자이너는 구성 요소를 로드하고 초기화할 때 이 할당을 수행합니다. 그러나 프로그래밍 방식으로 로드 하 고 구성 요소를 편집 하는 경우 디자이너 외부에서 개체 모델을 사용 하 여 속성을 명시적으로 설정 해야 합니다. 패키지의 Connections 컬렉션이 구성 요소에 노출되지 않으므로 구성 요소에서 속성을 사용하여 ConnectionManagerID 명시적으로 연결을 참조할 수 없습니다.

적용 대상