How to: Create a Database Connection
The features that make up Visual Studio Team System Database Edition use one or more database connections. Before you can connect to a database, you must create the connection. You can create a connection by clicking New Connection in the following dialog boxes:
Data Compare dialog box
Schema Compare dialog box
Connect to Database dialog box for the Transact-SQL (T-SQL) editor
Generate Data for Target Database dialog box for Data Generator
Database Test Configuration dialog box for database unit testing
You can also add a connection by using Server Explorer. For more information, see How to: Add New Data Connections in Server Explorer/Database Explorer.
Important Note: |
---|
You can remove connections only from Server Explorer. |
In this topic
To add a connection by clicking New Connection
Click New Connection.
The Connection Properties dialog box appears.
In Server Name, type or click the name of the server to which you want to connect.
To use your Microsoft Windows credentials to log on to the server, click Use Windows Authentication.
To use SQL Server authentication to log on to the server, click Use SQL Server Authentication, and then type your user name and password in User name and Password.
In Connect to a Database, type or click the name of the database to which you want to connect.
(optional) You can click Advanced to configure advanced connection properties.
(optional) You can click Test Connection to verify that you can connect to the database by using the specified connection information.
Click OK to create the connection.
To rename a connection
On the View menu, click Server Explorer.
Expand the Data Connections node, right-click the connection that you want to rename, and then click Rename.
Type the new name for the connection and press ENTER.
To modify a connection
On the View menu, click Server Explorer.
Expand the Data Connections node, right-click the connection that you want to rename, and then click Modify Connection.
The Modify Connection dialog box appears.
Update the information for the connection and then click OK.
If you decide not to modify the connection, click Cancel to discard your changes.
To delete a connection
On the View menu, click Server Explorer.
Expand the Data Connections node, right-click the connection that you want to rename, and then click Delete.
In the confirmation dialog box, click Yes to remove the connection.
Security
It is recommended that you do not select the Save my password check box to store your SQL Server password with the connection string.
See Also
Tasks
How to: Start the Transact-SQL Editor
How to: Run a Data Generation Plan to Generate Data
How to: Compare Database Schemas
How to: Compare the Data of Two Databases
Concepts
Overview of Connection Strings and Permissions
Change History
Date |
History |
Reason |
---|---|---|
Added procedure that describes how to remove connections to address customer feedback. |
Customer feedback. |