Package.EnableConfigurations Propriedade

Definição

Obtém ou define um valor que indica se o pacote carrega configurações.

public:
 property bool EnableConfigurations { bool get(); void set(bool value); };
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "EnableConfigurationsDesc")]
public bool EnableConfigurations { get; set; }
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "EnableConfigurationsDesc")>]
member this.EnableConfigurations : bool with get, set
Public Property EnableConfigurations As Boolean

Valor da propriedade

Boolean

true se o pacote carregar configurações; caso contrário, false.

Atributos

Exemplos

O exemplo a seguir cria um novo pacote e define o EnableConfigurations como true, bem como a ExportConfigurationFile propriedade. Em seguida, o exemplo adiciona uma nova configuração ao pacote e define o valor de várias propriedades.

Package pkg = new Package();  
pkg.EnableConfigurations = true;  
pkg.ExportConfigurationFile("conf.xml");  
// 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.  
Dim pkg As Package =  New Package()   
pkg.EnableConfigurations = True  
pkg.ExportConfigurationFile("conf.xml")  
' Create a variable object and add it to the   
' package Variables collection.  
Dim varPkg As Variable =  pkg.Variables.Add("var",False,"",100)   
varPkg.Value = 1  
Dim packagePathToVariable As String =  varPkg.GetPackagePath()   

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

Comentários

Se essa propriedade for definida como false, os valores persistentes no pacote serão usados, em vez de substituídos pelas configurações carregadas.

Ao implantar o pacote, você pode definir isso false com a última configuração. Em seguida, quando o pacote for executado pela primeira vez após a implantação, os valores do pacote serão substituídos uma vez pelos valores de configuração. Para obter mais informações sobre as configurações usadas por um pacote, consulte Criar Configurações de Pacote.

Aplica-se a