% title # Configure using app.config %> <% group # Configuration %> <% order # 10 %>
Since Microsoft has released FW 2.0 and the <connectionStrings> section of configuration file is available, it should be used. This configuration method is preferable. The following method demonstrates this ability.
OpenConfig1FW2.cs <% ..\..\..\HowTo\Data\OpenConfig1FW2.cs %> App.config <% Doc\Data\App1.config %>In addition BLToolkit supports an alternative way which uses the <appSettings> section. At the bottom of this page you can find a demo App.config file with a few examples.
BLToolkit recognizes configuration strings in the <appSettings> section by looking for a ConnectionString key prefix. Actual key value can be the following:
key value | Provider | Configuration |
---|---|---|
key="ConnectionString" | default provider | default configuration |
key="ConnectionString.Foo.Bar" | 'Foo' provider | 'Bar' configuration |
key="ConnectionString.Foo." | 'Foo' provider | default configuration |
key="ConnectionString.Foo" | default provider | 'Foo' configuration |
or | 'Foo' provider | default configuration |
key="ConnectionString..Foo" | default provider | 'Foo' configuration |
key="ConnectionString..Foo.Bar" | default provider | 'Foo.Bar' configuration |
The default configuration can be set by a configuration file:
App.config <% Doc\Data\App2.config %> Create.sql script