To connect to a SQL Server Database, complete the following:
- In the Solution Explorer, click the Data Sources node.
- On the Project menu, click Add Data Source. The Attach Data Source Wizard appears.
- In the Choose a data Source Type page, click Database, and then click Next.
- If the Choose Data Source dialog box appears, click Microsoft SQL Server, and then click Continue.
- In the Connection Properties dialog box, make sure that Microsoft SQL Server (SqlClient) appears as selected in the Data source box.
- In the Server name box of the Connection Properties dialog box, type the name of the SQL Server instance that you want to connect to.
- If your database is set up to sue Windows authentication, click Use Windows Authentication. Otherwise, click Use SQL Server Authentication, and then provide the user name and password of a user who has access to the database.
- Click Select or or enter a database name. Then, in the Select or enter a database name drop-down list, select or type the name of the database that you want to connect to, and then click Ok. The Choose Your Database Objects page appears.
- In the Choose Your Database Objects page, select the tables and views that you want to use in your LightSwitch application, and then click Finish. The database, tables, and views that you selected appear in the Solution Explorer as sub nodes of the Data Sources node.