Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2009

Tip: Looking for answers? Try searching our database.

Under what tag to put "add key="ConnectionString"......"?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aspfun - 28 Oct 2009 16:28 GMT
In web.config file, Under what tag to put "add key="ConnectionString"......"?
Put in  <appSettings> or <connectionStrings> ?
Mark Rae [MVP] - 28 Oct 2009 16:48 GMT
> 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...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Gregory A. Beamer - 29 Oct 2009 19:33 GMT
> 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,

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************

|      Think outside the box!             |
*******************************************

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.