cdonner
cdonner

Reputation: 37708

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?

Upvotes: 0

Views: 1613

Answers (3)

CF_Maintainer
CF_Maintainer

Reputation: 973

Did you use RAPI to copy the SQLCE database over to the PC and let the PC app work with it and when it was done, copied the database file back to the PDA?

I was thinking of doing something similar.

Please let me know if you faced any roadblocks/issues in the way.

Did you use OpenNETCF 2.3?

Upvotes: 1

cdonner
cdonner

Reputation: 37708

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.

Upvotes: 0

ctacke
ctacke

Reputation: 67198

You could write a custom socket communication protocol, so your mobile app would listen for a socket connection and the desktop would "call in" and then send commands.

Upvotes: 0

Related Questions