Click here to Skip to main content
13,627,356 members
Click here to Skip to main content
Add your own
alternative version

Stats

5.4K views
2 bookmarked
Posted 2 Mar 2011
Licenced CPOL

Get DataBase Connection Strings in Easy Way

, 3 Mar 2011
I get it from the web.config via ConfigurationManager.ConnectionStrings;This makes it possible to keep all connectionstring settings in the web.config file.For example: http://www.dreamincode.net/code/snippet1676.htm[^].

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

16 Feb 2011
jim lahey
Or you could just pop over to:http://www.connectionstrings.com/[^]Use the exhaustive samples they provide and not hard code your connection strings by using a standard .NET configuration file:http://msdn.microsoft.com/en-us/library/1xtk877y.aspx[^]
3 Mar 2011
crocks256
The ConnectionStringBuilder classes in .NET can be quite handy...http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.aspx[^].
27 Sep 2013
dontumindit
4 alternatives  
Communication with database in .NET is easy but sometimes one gets stuck by wrong format of connection string
1 Mar 2011
bipin9
goto Server Explorer right Click on DataBase Click on properties in properties window you will get Connection String copy it & use where you want use !!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

MikkelAndersen
Web Developer freelance
Denmark Denmark
This member doesn't quite have enough reputation to be able to display their biography and homepage.

Pro
| | Privacy | Cookies | Terms of Use | Mobile
Web03-2016 | 2.8.180712.1 | Last Updated 3 Mar 2011
Article Copyright 2011 by MikkelAndersen
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid