Click here to Skip to main content
13,352,161 members (74,532 online)
Click here to Skip to main content
Add your own
alternative version


3 bookmarked
Posted 14 May 2013

Get SQL Server Database Connection String Easily from Visual Studio

, 14 May 2013
Rate this:
Please Sign up or sign in to vote.
How to get SQL Server database connection string easily from Visual Studio
  1. Before getting to know this, you should know the following details of SQL Server:
    • Server Name
    • Username
    • Password
    • Database name which you want to connect
  2. Open Visual Studio.
  3. Go to view => Server Explorer.
  4. Right click on Data Connections and select Add Connection (or) click on Connect to Database icon.
  5. You will get add connection window.

    Provide Server name.

    Select Use SQL Server Authentication radio button. Then submit the username and password.

    If you enter correct details, you can select the database you want to connect from the “Select or enter a database name” dropdown list.

  6. Click on Test Connection button. If you submit the correct credentials, you will get the Test connection succeeded confirmation message.
  7. Now your connection is working successfully so, now click on ok button. You will get one data connection under Data Connections.
  8. Right click on your connection and select properties.
  9. You will get properties window of your connection. Find Connection String property and select the connection string.
  10. So now your connection string is in your hands you can use it anywhere you want.


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


About the Author

Srinubabu Ravilla
Software Developer (Senior) KANTAR
India India
No Biography provided

You may also be interested in...


Comments and Discussions

QuestionThank you! Pin
Sharath C V29-Sep-16 9:57
professionalSharath C V29-Sep-16 9:57 
GeneralMy vote of 1 Pin
agorby17-May-13 3:59
memberagorby17-May-13 3:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 14 May 2013
Article Copyright 2013 by Srinubabu Ravilla
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid