Remote SQL Server Compact Queries: Fun with VS2008 & ActiveSync
Posted by Dan Vanderboom on January 5, 2008
I wanted to show you how to use Server Explorer to connect to an ActiveSync-connected Windows Mobile device in order to write queries against a SQL Server Mobile/Compact database, so that I can demonstrate all of the problems I’ve had with that tool, the error messages I’ve encountered, and to explain just why I’ve chosen to write a replacement for it. However, a funny thing happened on the way to the forum…
Trouble at the Start
In setting up for writing this query, I intended to use the emulator, but quickly realized that creating an ActiveSync connection to it presented some difficulties. In an older version of the Windows Mobile Developer Power Toys, there was a driver that supported ActiveSync connections to an emulator device (which can be found here), but this was targeted for Visual Studio 2003. When I tried installing it to see if it would work on VS2008, I first got a nasty warning that the publisher couldn’t be verified (isn’t it Microsoft?), and then was told that Vista was rejecting it due to incompatibility. The new v3.5 of the Power Toys does not include this driver. Bummer.
Not knowing where my Symbol MC50 is at the moment, I decided to use my WM5 cell phone (an AT&T 8525). With the restrictive security blocking my attempt to deploy and debug from Visual Studio, I had to use the Device Security Manager (under the Tools menu), which is a very handy tool. After connecting to the device (after several spontaneous network hiccups), I selected “Security Off”, right-clicked on the connected device, and chose Deploy. After that, I was able to deploy and debug on the device wirelessly.
A good start, but next I needed to connect via ActiveSync. I plugged in the USB cable between my cell phone and PC, and nothing happened. I tried all of the USB ports, rebooted my cell phone and laptop, made sure Windows Mobile Device Center was running on the PC and the ActiveSync window was running on the mobile device, I pressed the “Sync” menu button on the device, … but nothing happens. It’s “Waiting for network” supposedly. I’ve gotten ActiveSync to work with my cell phone many times in the past (though not consistently).
I also tried using the Device Emulator Manager, shown below. If you right-click, you get a context menu with an option to Cradle, which I hoped would trigger an ActiveSync, but it doesn’t. Either it’s just not supported, or ActiveSync is angry with my device for some reason.
To Be Continued…
This is typical of the kind of behavior that has given me the opinion that ActiveSync is a piece of junk, and any tool or technology built on top of it will be susceptible of the same unreliability. I’m very busy and have a lot to get done in a short period of time, and mobile device development is already inherently complicated and slow compared to desktop development. I just don’t have time to fight with the tools like this.
I will find another device, get it to ActiveSync, and then return to this topic in a future article to demonstrate the remote query tool inside VS2008. Then I’ll get back to solving the problem with my new product.