windows-mobilesql-server-cerapi

Accessing a SQL Server CE database on a Windows Mobile 6 device


I have a mobile app that writes to a SQL Server CE database on the device. I want to write a desktop application that can read this data and export it in CSV format. I have been looking at RAPI (Remote Api), but I would prefer to do this entirely with managed code. Is there an alternative to RAPI?


Solution

  • The reason why I asked this question initially was my concern that RAPI was going to be too involved for my little app (after looking at the API docs). I started out writing a wrapper library in unmanaged code nontheless, only to realize that I would have to carry the entire C++ runtime environment along. So I ended up cobbling together a few methods for RAPI file handling and file system operations that call RAPI directly from C# using P/Invoke. I found a few of these methods in various places, added some more of my own, and put them all in a C# class. I fitted them with consistent error handling, and it turned out to do exactly what I needed, after only a few hours of effort.