Package.Configurations 属性

Gets the collection of configurations for the package. A package can have more than one configuration associated with it. This property is read-only.

命名空间:  Microsoft.SqlServer.Dts.Runtime
程序集:  Microsoft.SqlServer.ManagedDTS(在 Microsoft.SqlServer.ManagedDTS.dll 中)

语法

声明
Public ReadOnly Property Configurations As Configurations 
    Get
用法
Dim instance As Package 
Dim value As Configurations 

value = instance.Configurations
public Configurations Configurations { get; }
public:
property Configurations^ Configurations {
    Configurations^ get ();
}
member Configurations : Configurations
function get Configurations () : Configurations

属性值

类型:Microsoft.SqlServer.Dts.Runtime.Configurations
The collection of configurations for the package.

注释

Each configuration allows you to set a package variable from an external source, such as from a configuration file, environment variable, or registry entry. For more information about package configuration, see 创建包配置.

示例

The following example loads a sample package, and then returns a count of the number of configurations associated with the package.

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

请参阅

参考

Package 类

Microsoft.SqlServer.Dts.Runtime 命名空间