view Tools/DocGen/Content/Doc/Data/OpenConfig1.htm @ 3:1ef98bd70424

!bug 100 +3h Исправление проблемы BLToolkit + mono 3.4
author cin
date Fri, 22 Aug 2014 17:34:46 +0400
parents f990fcb411a9
children
line wrap: on
line source

<% title # Configure using app.config %>
<% group # Configuration %>
<% order # 10 %>
<p class='j'>
Since Microsoft has released FW 2.0 and the <b>&lt;connectionStrings&gt;</b> section of
configuration file is available, it should be used. This configuration method is preferable.
The following method demonstrates this ability.
</p>
OpenConfig1FW2.cs
<% ..\..\..\HowTo\Data\OpenConfig1FW2.cs %>
App.config
<% Doc\Data\App1.config %>

<p class='j'>
In addition <b>BLToolkit</b> supports an alternative way which uses the <b>&lt;appSettings&gt;</b> section.
At the bottom of this page you can find a demo <a href='#cfg'>App.config</a> file with a few examples.
</p>
<p class='j'>
<b>BLToolkit</b> recognizes configuration strings in the <b>&lt;appSettings&gt;</b> section 
by looking for a <b>ConnectionString</b> key prefix. Actual key value can be the following:

<table class='data'>
<tr><th>key value</th><th>Provider</th><th>Configuration</th></tr>
<tr><td><span class='kw'>key</span>=<span class='str'>"ConnectionString"</span></td><td align='right'>default provider</td><td align='right'>default configuration</td></tr>
<tr><td><span class='kw'>key</span>=<span class='str'>"ConnectionString.Foo.Bar"</span></td><td align='right'>'Foo' provider</td><td align='right'>'Bar' configuration</td></tr>
<tr><td><span class='kw'>key</span>=<span class='str'>"ConnectionString.Foo."</span></td><td align='right'>'Foo' provider</td><td align='right'>default configuration</td></tr>
<tr><td><span class='kw'>key</span>=<span class='str'>"ConnectionString.Foo"</span></td><td align='right'>default provider</td><td align='right'>'Foo' configuration</td></tr>
<tr><td align='right'>or</td><td align='right'>'Foo' provider</td><td align='right'>default configuration</td></tr>
<tr><td><span class='kw'>key</span>=<span class='str'>"ConnectionString..Foo"</span></td><td align='right'>default provider</td><td align='right'>'Foo' configuration</td></tr>
<tr><td><span class='kw'>key</span>=<span class='str'>"ConnectionString..Foo.Bar"</span></td><td align='right'>default provider</td><td align='right'>'Foo.Bar' configuration</td></tr>
</table>

Default provider is <b>SqlDataProvider</b>.
See also <a href='DataProvider/index.htm'>Data Providers</a>.
</p>

OpenConfig1.cs
<% ..\..\..\HowTo\Data\OpenConfig1.cs %>
<a name='cfg'/>App.config
<% ..\..\..\UnitTests\All\App.config %>

<p class='j'>The default configuration can be set by a configuration file:</p>
App.config
<% Doc\Data\App2.config %>

<a href="CreateSql.htm">Create.sql script</a>