|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Add New Data Connections in Server Explorer/Database Explorer
Server Explorer/Database Explorer displays database connections beneath the Data Connections node. After a connection is established, you can design programs to open connections and retrieve and manipulate the data provided, or directly access and work with the data using.
In the Visual Studio Express products, this window is named Database Explorer. In all other Visual Studio products, this window is named Server Explorer.
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see.
To add a data connection in Server Explorer/Database Explorer
On the Tools menu, choose Connect to Database.
The Choose Data Source dialog box opens. For more information, see.
The Choose Data Source dialog box only appears the first time you create a connection. The selected data source becomes the default for each subsequent connection.
Select the type of data source to connect to from the Data source list. Click Continue and the Add Connection dialog box opens. The Add Connection dialog is specific to the data source selected in the previous step. For more information, see.
If the Add Connection dialog box is not set to the correct data source click the Change button to open the Choose Data Source dialog box and select a different data source.
Enter the information required to connect to the selected data source and click OK to create the connection.
The Add Connection dialog box closes, and the new data connection appears beneath the Data Connections node.
For example, if you create a data connection to a database called Northwind on a server named Server1, a new connection named Server1.Northwind.dbo appears beneath the Data Connections node.
To remove a data connection from Server Explorer/Database Explorer
In Server Explorer, expand the Data Connections node.
Select the desired database connection.
Press the DELETE key.
There is no effect on the actual database. You are removing the reference from your view.