How to: Connect to a SQL Server Compact Database by Using Visual Studio

This topic describes how to connect to a SQL Server Compact 3.5 database by using Visual Studio.

To connect to a database

  1. Open Visual Studio.

  2. At the top right, open Server Explorer.

  3. In the Server Explorer, right click Data Connections.

  4. Click Add Connection.

  5. In the Choose Data Source dialog box, select Microsoft SQL Server Compact 3.5 and then click Continue.

  6. In the Add Connection dialog box, browse for the SQL Server Compact 3.5 database.

    Important

    In the Add Connection dialog box, to set the maximum size for a database, click Advanced. In the Advanced Properties box, under Max Database Size, specify a database size greater than or equal to the size of the SQL Server Compact 3.5 database that you plan to connect to. The default value of the Max Database Size property is 128 MB for devices and 256 MB for desktops.