Document number | Revision |
---|---|
DOCU12196 | 1 |
This article introduces code samples for <connectionStrings> and <appSettings> section.
Using hard coded database name:
<connectionStrings>
<add name="default" connectionString="server=MyServer;database=MyDatabase;uid=MyName;pwd=MyPassword" />
</connectionStrings>
Using application name as database name:
xxxxxxxxxx
<connectionStrings>
<add name="default" connectionString="server=MyServer;database=@[ApplicationName];uid=MyName;pwd=MyPassword " />
</connectionStrings>
Tip!
The <connectionStrings> section may be encrypted by clicking the
Web.config
protection link found in System>security menu.
In the web.config file <appSettings> section it is possible to overrule parameters found in parameter table.
The following sample will set the mail parameter for all applications:
<appSettings>
<add key="Mail" value="0" />
</appSettings>
The following sample will set the mail parameter for the Test application only:
<appSettings>
<add key="Test:Mail" value="0" />
</appSettings>
When listing system parameters in TurboStage the parameter value from the table will be shown in addition to the actual running value from web.config
application that overrules the table parameter.
Parameters will be listed in the following way:
Name | Value |
---|---|
1 (Running value: 0) |
The Application name may be used as parameter:
<appSettings>
<add key="SchemaFile" value="@[ApplicationName].schema.xml" />
</appSettings>
Available parameters:
Name | Description |
---|---|
ApplicationName | Name of application (or website). In a hosting environment it may be important that the name is unique to enable different web.config for different applications (or websites). |
<parameter name> | Already loaded parameters |