Export (0) Print
Expand All

How to: Connect to a Database

This topic applies to:

Visual Studio Edition

Visual Basic

C#

C++

J#

Visual Web Developer

Express

No

No

No

No

No

Standard

No

No

No

No

No

Pro/Team

Yes

Yes

Yes

Yes

Yes

This section describes how to set up a database connection in Microsoft Visual Studio 2005.

NoteNote

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

  1. On the View menu, click Server Explorer.

  2. In Server Explorer, right-click Data Connections, and click Add Connection.

  3. In the Choose Data Source dialog box, click 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.

  4. Click the Continue button.

    The Add Connection dialog box appears.

  5. In the Server name box, select or type the name and instance of the SQL Server to connect to, in the form machine name\instance name. To connect to the default instance, only type the machine name.

  6. In the Log on to the server pane, type the user name and password to access the server or select Use Windows NT Integrated Security, depending on your type of security and credentials.

  7. In the Select or enter a database name box, select or type the name of the database.

  8. Click the Test Connection button to verify that the connection exists.

  9. Click OK.

See Also

Community Additions

ADD
Show:
© 2015 Microsoft