IDTSRuntimeConnection100.ConnectionManager Özelliği
Alır veya ayarlar IDTSConnectionManager100 run - tarafından başvurulan nesnesaat bağlantı nesnesini.
Ad Alanı: Microsoft.SqlServer.Dts.Pipeline.Wrapper
Derleme: Microsoft.SqlServer.DTSPipelineWrap (Microsoft.SqlServer.DTSPipelineWrap içinde.dll)
Sözdizimi
'Bildirim
Property ConnectionManager As IDTSConnectionManager100
Get
Set
'Kullanım
Dim instance As IDTSRuntimeConnection100
Dim value As IDTSConnectionManager100
value = instance.ConnectionManager
instance.ConnectionManager = value
IDTSConnectionManager100 ConnectionManager { get; set; }
property IDTSConnectionManager100^ ConnectionManager {
IDTSConnectionManager100^ get ();
void set (IDTSConnectionManager100^ value);
}
abstract ConnectionManager : IDTSConnectionManager100 with get, set
function get ConnectionManager () : IDTSConnectionManager100
function set ConnectionManager (value : IDTSConnectionManager100)
Özellik Değeri
Tür: Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager100
IDTSConnectionManager100 Bileşeni.
Açıklamalar
ConnectionManager özellik içerir veya ayarlar, gerçek bir başvuru örnek , IDTSConnectionManager100 nesnenin içerdiği paket.Çalışma zamanında, bu başvuru tarafından otomatik olarak küme SSIS çalışma zamanı altyapısı kullanılarak ConnectionManagerID özellik bağlantıyı bulmak için paket ve atama başvuru.
Tasarım sırasında saat SSIS Tasarımcısı mu bu atama, yükleme ve başlatma bileşeni.Ancak, program aracılığıyla yükleme ve düzenleme Tasarımcısı dışında nesne modelini kullanarak bir bileşen özellik olmalıdır küme açıkça.Bileşenler kullanılarak açıkça bağlantı başvurmak için özelliğine sahip ConnectionManagerID özellik nedeniyle Connections koleksiyon paket bileşenleridir. maruz kalmaz
Örnekler
Aşağıdaki kod örneği gösterir nasıl ConnectionManager özellik yüklenirken programlı olarak küme bir paket.
// 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.");
}
}
}
}
' 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
Ayrıca bkz.