Bagikan melalui


Package.Configurations Properti

Definisi

Mendapatkan kumpulan konfigurasi untuk paket. Paket dapat memiliki lebih dari satu konfigurasi yang terkait dengannya. Properti ini bersifat hanya baca.

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

Nilai Properti

Configurations

Kumpulan konfigurasi untuk paket.

Contoh

Contoh berikut memuat paket sampel, lalu mengembalikan hitungan jumlah konfigurasi yang terkait dengan paket.

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  

Keterangan

Setiap konfigurasi memungkinkan Anda mengatur variabel paket dari sumber eksternal, seperti dari file konfigurasi, variabel lingkungan, atau entri registri. Untuk informasi selengkapnya tentang konfigurasi paket, lihat Membuat Konfigurasi Paket.

Berlaku untuk