Instructions for Installing and using the SQL CE plugins

The SQL CE plugins are new assemblies written to allow DbViewSharp to work with SQL Compact Edition databases. This page outlines the steps required to install and access the plugins in DbViewSharp and describes some of the differences in behaviour.

Installing the plugins

Firstly note that the installer for the plugins does not install the actual SQL Ce software itself. That said the installers, downloadable from Microsoft are very small and easy to use.

Secondly note that the installer will enable you to install either one or both versions of SQL CE: 3.5 and 4.0. If you only use one version it is probably better only to install that one version. However you will be able to use DbViewSharp to upgrade database files from 3.5 to 4.0 if you install both.

The DbViewSharp SQL CE plugin installer is available from the downloads section and you should install it in the same folder as you installed your version of DbViewSharp.

First time users take note

If this is the first time you have downloaded and installed DbViewSharp and have also installed the SQL CE plugins you may find when you following the introduction that the connection form looks different to the one described in the document. This is because for new users the selection of the initial plugin to use is somewhat random and the program may be using the SQL CE plugin instead of Sql Server, which the document assumes. Either refer to documentation on the Codeplex site or cancel the form, select File, Change Database Manager from the menu, select Sql Server and continue with the document.

Using DbViewSharp

If you have used DbViewSharp before with Sql Server databases you will probably not notice any difference when you launch it following the installation. However when you select the Menu option File, Change Database Manager from the menu you will now get a choice in the form.
When you select one of the Sql Server Compact options you will next see a connection form very similar to the one you are used to, but empty. This is because I'm lazy and have adapted the Sql Server form. With the modified form you can either attach to existing database files or create entirely new ones. In both cases you start by pressing the New button.
To attach to an existing file:
  1. Press New. You are asked whether you wish to create a new database file. Answer No
  2. Fill in the Connection Name box. This is the descriptive name that DbViewSharp will use to refer to the database.
  3. Either enter the folder path to the file or press Browse to find the file using a standard file open dialog.
  4. If the file is password-protected then enter the password as well.
  5. Test, Save and Connect to view the table list.
To create a new file:
  1. Press New. You are asked whether you wish to create a new database file. Answer Yes
  2. You are prompted to save a .SDF file in a folder of your choice. This will be the name and location of the new database file. When you press OK the database file is created and the boxes on the connection form filled with relevant details.
  3. You have a chance now to change the connection name.
  4. You also have a chance now to set a password for the database.
  5. Test, Save and Connect. The table list will be empty, but you can use the create table menu option to add simple tables or failing that the Ad-hoc query window.

Differences to note when connected
  1. The plugin custom menu title changes from "Sql Server" to "SqlCE 3.5" or "SqlCE 4" depending on which plugin driver you selected.
  2. Most of the items in the "Show" menu dropdown are grayed. This is because the objects and features are not supported in Sql Server CE.
  3. There is only one option in the Search source form for the same reason.
  4. The SqlCE custom menu has (at the time of writing) only a single option; to create a table.

New Features

DbViewSharp is very careful with what it allows you to do in terms of changing stuff on a Sql Server database. Almost all it allows is changing data, and that only grudgingly. This was a deliberate design policy to prevent me accidently trashing my production databases. However since a. I don't have production SqlCE database files and b. as single standalon files they are so much easier to backup and restore, I plan to take the gloves off with these plugins.

You've already seen that you can create entirely new database files. Other options accessible from the connection form by right-clicking on a row in the list are:
  • Back-up.
  • Set, unset or change the password.
  • Upgrade a file created by an older version of SqlCE to the current driver version.

Create table

Accessed either from the menu or right-click from the Tables grid, this is a form that allows you to set up a simple table with a limited number of fields as long as you only need the common column types.
Note: if you find you cannot add a particular feature then simply add everything you can and press Preview. This handily copies the script into the clipboard. You can then paste it either into Sql Management Studio, Visual Studio or indeed the DbViewSharp Ad-Hoc window, make the necessary changes and execute it there.

Watch out for
  • Installing a plugin when you have not installed the corresponding version of SqlCE. In this case you will get a scary looking message when you load DbViewSharp and annoying error messages if you try to use the driver. To fix this re-run the installer and de-select the plugin installed by accident. Alternatively download and install the engine from Microsoft.
  • On 64-bit machines beware the little wrinkle installing SQL CE 3.5. You need to install both the 32-bit and 64-bit versions. It's fairly clearly documented, but if you miss it you will get some obscure error messages.
  • Future you. If you upgrade to a newer version of DbViewSharp I would advise installing the corresponding versions of the plugins. I'm not sure what management future upgrades will need and this strikes me as an area easy to make mistakes in.

Good Luck and...

Remember I do not work with Sql CE databases. If you do and you like the experience with DbViewSharp do report bugs and make suggestions for enhancements. Use the Codeplex site or the contact E-mail.

Last edited Mar 24, 2012 at 9:43 PM by Dave999, version 2


No comments yet.