Package.Configurations Eigenschaft

Definition

Ruft die Auflistung der Konfigurationen für das Paket ab. Einem Paket kann mehr als eine Konfiguration zugeordnet werden. Diese Eigenschaft ist schreibgeschützt.

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

Eigenschaftswert

Configurations

Die Auflistung der Konfigurationen für das Paket.

Beispiele

Im folgenden Beispiel wird ein Beispielpaket geladen und anschließend eine Anzahl der Konfigurationen zurückgegeben, die dem Paket zugeordnet sind.

class PackageTest  
    {  
        static void Main(string[] args)  
        {  
            // The variable pkg points to the location of the  
            // ExecuteProcess package sample 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);  

            int n = p.Configurations.Count;  
            Console.WriteLine("Number of configurations = " + n);  
        }  
    }  
Class PackageTest  
        Shared  Sub Main(ByVal args() As String)  
            ' The variable pkg points to the location of the  
            ' ExecuteProcess package sample 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 n As Integer =  p.Configurations.Count   
            Console.WriteLine("Number of configurations = " + n)  
        End Sub  
End Class  

Hinweise

Jede Konfiguration ermöglicht es Ihnen, eine Paketvariable aus einer externen Quelle festzulegen, z. B. aus einer Konfigurationsdatei, Umgebungsvariable oder Registrierungseintrag. Weitere Informationen zur Paketkonfiguration finden Sie unter Erstellen von Paketkonfigurationen.

Gilt für: