How to: Upgrade Managed Projects to SQL Server Compact 3.5 (Devices)

This topic explains how to upgrade an existing SQL Server 2005 Compact Edition 3.1 data project to use SQL Server Compact 3.5. After the upgrade, your project can take advantage of rich data features in Visual Studio and enhancements in SQL Server Compact 3.5. For more information, see Using SQL Server Compact 3.5 Databases (Devices).

Important noteImportant Note:

In order to have an existing managed data project, you must first complete Walkthrough: Creating Windows Forms Applications for a Device and the complete How to: Use SQL Server 2005 Compact Edition 3.1 in Managed Projects (Devices) before you begin.

To remove the SQL Server 2005 Compact Edition 3.1 reference

  1. Open the device project that you created by completing How to: Use SQL Server 2005 Compact Edition 3.1 in Managed Projects (Devices).

  2. Complete the following steps for a C# project.

    1. In Solution Explorer, expand References.

    2. In the References list, right-click System.Data.SqlServerCe and then click Remove.

  3. Complete the following steps for a Visual Basic project.

    1. On the Project menu, click DeviceSample Properties.

    2. Click the References tab in the Project Designer.

    3. In the References list click System.Data.SqlServerCe and the click Remove.

To add the SQL Server Compact 3.5 reference

  1. In Solution Explorer, right-click the project and then click Add Reference.

    The Add Reference dialog box appears.

  2. Click the Browse tab, find the file drive:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\System.Data.SqlServerCe.dll, and then click OK.

To convert a database file from version 3.1 format to version 3.5 format

  1. On the View menu click Server Explorer.

    Server Explorer appears.

  2. Right-click Data Connections and then click Add Connection.

    The Add Connection dialog box appears.

  3. Click Browse.

    The Select SQL Server Compact 3.5 Database File dialog box appears.

    Note

    Create a backup copy of the database before converting it.

  4. Navigate to the project folder, click Northwind.sdf, and then click Open.

  5. Click OK in the Add Connection dialog box.

  6. Click OK in the Upgrade to SQL Server Compact 3.5 Database dialog box.

See Also

Concepts

Using SQL Server 2005 Compact Edition 3.1 Databases (Devices)

Using SQL Server Compact 3.5 Databases (Devices)