Click here to Skip to main content
15,891,905 members
Articles / .NET

Get DataBase Connection Strings in Easy Way

Rate me:
Please Sign up or sign in to vote.
5.00/5 (13 votes)
16 Feb 2011CPOL 18.8K   4  
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[^]

Alternatives

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

Please Sign up or sign in to vote.
3 Mar 2011crocks256
The ConnectionStringBuilder classes in .NET can be quite handy...http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.aspx[^].
Please Sign up or sign in to vote.
27 Sep 2013dontumindit 4 alternatives  
Communication with database in .NET is easy but sometimes one gets stuck by wrong format of connection string
Please Sign up or sign in to vote.
1 Mar 2011bipin9
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 !!
Please Sign up or sign in to vote.
3 Mar 2011MikkelAndersen
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[^].

License

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


Written By
Software Developer (Senior)
United Kingdom United Kingdom
First batch file in 1987

Messed around with the Bullfrog C++ Libraries for Syndicate in 1994

Web Developer since 2000

.net Developer since 2001

MCTS: Microsoft® .NET Framework 2.0 - Web-based Client Development

MCTS: Web Applications Development with Microsoft .NET Framework 4

Comments and Discussions