Monday, 28 April 2008

Setting up Windows Mobile for SQL CE

My battle against Windows Mobile 5 continues. Set back initially by its limited support for databases, i was forced to adapt my (poorly written) code to use SqlCe which doesn't even fully support the SQL dictionary.

With some - even if limited - database implementation I hoped to move from the VS Emulator to the actual device. Predictable this was not easy. Despite SqlCe .sdf file capabilities and even a program already on the device to open such files - my program refused to run.

Missing libraries. Installing these librarys was more painful than it should have been. Originally i hoped that the compiler and linker would copy all necessary code into the executable file. After all the program ran in the emulator fine. Unable to find an installer for just SqlServerCe which would run on the device itself, i manually hunted out the necessary .CAB files (as spotted in the output pane of VS during deployment) onto the device, learning during the process that they must be installed to 'This Device' and none of the other options for .CAB installation.

These tricks eventually coaxed windows into running my program. Fortunately my luck changed at this point.

I discovered a very useful way of quickly starting the emulator without having to wait for the deployment of all the library files each time. Basically, once it has successfully deployed once, enter the settings>memory>running programs and then stop all processes. Save the state (File>Save State) and close the window. Next time you hit debug it will load much quicker.

No comments: