Thursday, September 2, 2010

SQL Server Compact Toolbox add-in now supports version 4.0 databases

The latest release of the SQL Server Compact Toolbox, an add-in for Visual Studio 2010, includes support for version 4.0 (CTP1) SQL Server Compact database files in addition to version 3.5 files.

To start using the add-in with version 4 files, download and install the latest release (1.4 at the time of writing this).

Using 4.0 files with the add-in

Create the file, using either SqlCeCmd40, WebMatrix or another tool, that supports 4.0.

Create a permanent connection, by selecting “Add SQL Server Compact 4.0 Connection”:

image

The simple dialog allows you to build the connection string and test it.

image

When you select “Save”, the connection information is saved in a version 3.5 database file here:

C:\Users\<Username>\AppData\Local\SqlCe35AddinStore.sdf

(An empty database is included as an Embedded Resource with the add-in, to see how to extract this to a sdf file using C#, see the DataConnectionHelper.cs in the source).

To remove the connection, select a version 4 connection in the tree, and select “Remove Connection”.

image

When the Visual Studio Server Explorer support for version 4 arrives, the add-in will be updated to enumerate your version 4 connections from Server Explorer rather than having a separate store for these.

No comments: