| .NET DotNet Forum Index » ASP.NET Forum » Under what tag to put "add... |
|
Page 1 of 1 |
|
| Author |
Message |
| aspfun via DotNetMonster.com... |
Posted: Wed Oct 28, 2009 9:28 am |
|
|
|
Guest
|
|
| Back to top |
|
|
|
| Mark Rae [MVP]... |
Posted: Wed Oct 28, 2009 9:48 am |
|
|
|
Guest
|
"aspfun via DotNetMonster.com" <u53138 at (no spam) uwe> wrote in message
news:9e45d7441375a at (no spam) uwe...
Quote: In web.config file, Under what tag to put "add
key="ConnectionString"......"?
Put in <appSettings> or <connectionStrings> ?
You can put it in either. Which one you choose will depend upon the syntax
you use for retrieving it.
However, the "connectionStrings" section is clearly designed for connection
strings (the clue's in the name), so I'd put it there...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net |
|
|
| Back to top |
|
|
|
| Gregory A. Beamer... |
Posted: Thu Oct 29, 2009 12:33 pm |
|
|
|
Guest
|
"aspfun via DotNetMonster.com" <u53138 at (no spam) uwe> wrote in
news:9e45d7441375a at (no spam) uwe:
Quote: In web.config file, Under what tag to put "add
key="ConnectionString"......"? Put in <appSettings> or
connectionStrings> ?
If you are using <add key="", you cannot put it under Connection Strings,
so it goes under app settings. This is the incorrect way to do things,
however.
If you want it to be a connection string, the format will be <add name="",
etc.
it is better to place connection strings in the <ConnectionString> section,
as there is more than just a key value when you explicitly set up a
connection string. Some items may not be important to you now, but why
break convention at this time?
Peace and Grace,
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Twitter: at (no spam) gbworld
Blog: http://gregorybeamer.spaces.live.com
*******************************************
| Think outside the box! |
******************************************* |
|
|
| Back to top |
|
|
|
|