How to: Connect to a Database with Server Explorer
This topic applies to:
Visual Studio Ultimate |
Visual Studio Premium |
Visual Studio Professional |
Visual Studio Express |
---|---|---|---|
This section describes how to set up a database connection with Server Explorer in Visual Studio when debugging Transact-SQL with SQL Server 2005, or later.
Note
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 Visual Studio Settings.
To set up a database connection in Server Explorer
On the View menu, click Server Explorer.
In Server Explorer, right-click Data Connections, and click Add Connection. This opens the Add Connection dialog box.
In the Data Source dialog box, click Change to specify the data source. In the Change Data Source dialog box, select Microsoft SQL Server from the Data source list and ensure that the Data provider list is set to .NET Framework Data Provider for SQL Server.
In the Server name box, select or type the name and instance of the SQL Server computer to connect to, in the form computer name\instance name. To connect to the default instance, only type the computer name.
In the Log on to the server pane, select Use Windows Authentication or Use SQL Server Authentication, depending on your type of security and credentials.
In the Select or enter a database name box, select or type the name of the database.
Click the Test Connection button to verify that the connection exists.
Click OK.