다음을 통해 공유


IDTSRuntimeConnection90.ConnectionManager Property

Gets or sets the IDTSConnectionManager90 object referenced by the run-time connection object.

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

구문

‘선언
<DispIdAttribute(102)> _
Property ConnectionManager As IDTSConnectionManager90
[DispIdAttribute(102)] 
IDTSConnectionManager90 ConnectionManager { get; set; }
[DispIdAttribute(102)] 
property IDTSConnectionManager90^ ConnectionManager {
    IDTSConnectionManager90^ get ();
    void set ([InAttribute] IDTSConnectionManager90^ ppIDTSConnectionManager);
}
/** @property */
/** @attribute DispIdAttribute(102) */ 
IDTSConnectionManager90 get_ConnectionManager ()

/** @property */
/** @attribute DispIdAttribute(102) */ 
void set_ConnectionManager (/** @attribute InAttribute() */ IDTSConnectionManager90 ppIDTSConnectionManager)
DispIdAttribute(102) 
function get ConnectionManager () : IDTSConnectionManager90

DispIdAttribute(102) 
function set ConnectionManager (ppIDTSConnectionManager : IDTSConnectionManager90)

속성 값

The IDTSConnectionManager90 of the component.

주의

The ConnectionManager property contains, or sets, a reference to the actual instance of the IDTSConnectionManager90 object contained in the package. At runtime, this reference is set automatically by the SSIS runtime engine using the ConnectionManagerID property to locate the connection in the package and assign a reference.

At design time the SSIS Designer does this assignment when loading and initializing a component. However, when programmatically loading and editing a component, using the object model outside of the designer, the property must be set explicitly. Components do not have the ability to reference the connection explicitly using the ConnectionManagerID property because the Connections collection of the package is not exposed to components.

The following code example shows how the ConnectionManager property is set when programmatically loading a package.

// 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( IDTSComponentMetaData90 md in mp.ComponentMetaDataCollection )
        {
            // Walk the RuntimeConnectionCollection.
            foreach( IDTSRuntimeConnection90 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.ToConnectionManager90(p.Connections[rc.ConnectionManagerID]);
                else
                    Console.WriteLine("The ConnectionManager " + rc.ConnectionManagerID + " was not found in the Package's Connections collection.");
            }
        }
    }
}
' 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 IDTSComponentMetaData90 In mp.ComponentMetaDataCollection 
     ' Walk the RuntimeConnectionCollection.
     For Each rc As IDTSRuntimeConnection90 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.ToConnectionManager90(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

스레드 보안

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 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

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