Package.Connections Özelliği
Döndürür koleksiyon paket için bağlantı yöneticileri.
Ad Alanı: Microsoft.SqlServer.Dts.Runtime
Derleme: Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS içinde.dll)
Sözdizimi
'Bildirim
Public ReadOnly Property Connections As Connections
Get
'Kullanım
Dim instance As Package
Dim value As Connections
value = instance.Connections
public Connections Connections { get; }
public:
property Connections^ Connections {
Connections^ get ();
}
member Connections : Connections
function get Connections () : Connections
Özellik Değeri
Tür: Microsoft.SqlServer.Dts.Runtime.Connections
A Connections koleksiyon.
Açıklamalar
Bağlantı yöneticileri görevleri alttaki veri deposu için genel bir arabirim daha basit görev uygulaması için izin verir.Use AcquireConnection yöntem, ConnectionManager herhangi bir Bağlantı Yöneticisi nesneleri gerekli bağlantı bilgilerini almak için nesne koleksiyon.
Bağlantı Yöneticisi adı veya GUID tarafından başvurulması ve Bağlantı Yöneticisi'nde adını saklayabilirsiniz bir yapılandırma dosyası.To reference the connection by name, use \Package.Connections[myConnection].ConnectionString, instead of using \Package.Connections[{9930DA64-A413-4286-9C66-74EDADB4F393}].ConnectionString.
Bağlantıları ve bağlantı yöneticileri hakkında daha fazla bilgi için bkz: Tümleştirme Hizmetleri bağlantıları.
Örnekler
Aşağıdaki örnek yükler UsingExecuteProcess paketi örnek ve bağlantıları hakkında bazı özelliklerini görüntüler ve paket tarafından kullanılan bağlantılar alır.
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
Örnek Çıktı:
Name = FILE, HostType = ConnectionManager
Name = OLEDB, HostType = ConnectionManager
Name = OLEDB, HostType = ConnectionManager