Package.EnableConfigurations Property

Indicates whether the package loads configurations.

Namespace: Microsoft.SqlServer.Dts.Runtime
Assembly: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

public bool EnableConfigurations { get; set; }
/** @property */
public boolean get_EnableConfigurations ()

/** @property */
public void set_EnableConfigurations (boolean value)

public function get EnableConfigurations () : boolean

public function set EnableConfigurations (value : boolean)

Property Value

true indicates that configuration files are loaded when the package is loaded.

If this property is set to false, the persisted values in the package will be used, rather than overwritten by the loaded configurations.

When deploying the package, you can set this to false with the last configuration. Then, when the package is first run after deployment, the package values will be overwritten once by the configuration values. For more information about configurations used by a package, see Creating Package Configurations.

The following example creates a new package, and then sets the EnableConfigurations to true, as well as the ExportConfigurationFile property. The example then adds a new configuration to the package and sets the value of several properties.

            Package pkg = new Package();
            pkg.EnableConfigurations = true;
            // Create a variable object and add it to the 
            // package Variables collection.
            Variable varPkg = pkg.Variables.Add("var", false, "", 100);
            varPkg.Value = 1;
            string packagePathToVariable = varPkg.GetPackagePath();

            Configuration config = pkg.Configurations.Add();
            config.ConfigurationString = "conf.xml";
            config.ConfigurationType = DTSConfigurationType.ConfigFile;
            config.PackagePath = packagePathToVariable;
            // more code here.

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

Community Additions