Link to home
Create AccountLog in
Avatar of vlachosg
vlachosg

asked on

synchronize sqlite database from handheld (windows 5 ce) with mysql (debian lenny)

Hello,

Could you please instruct me on the best approach to solve the following problem...

I have written an app in c# using .net CF  for windows  5  ce ( running on a dolhpin 6100 honeywell ) that inserts data to a database within the windows ce device (sqlite). Now the plan is to be able to unload the data from the sqlite in the windows ce device into a debian box that hosts a  mysql database.

At the moment what I do is I place the windows mobile device in the deck on a desktop pc and with active synch I get the sqlite database file that later I ftp it to the debian box that hosts the mysql database.

Then a script reads that file and inserts the record in the database.


What I want to achieve is a more elegant solution that would make it possible to read the file from within the windows mobile device (when I place it in deck  or wireless ) and directly unload it in the mysql server.

If I connect the device with the network and assign to it an ip would it be possible to connect to the mysql server from within the windows mobile? Eg have a button that says "Dump Data" that when I press it will try to find the mysql server (specific IP) connect to it and dump the data to the main database?

Or this is quite difficult to be done and I should just try to ftp from within the windows CE to the debian box and upload  the file there.

 

Any other opinions are welcome.

Thanks
Avatar of alexey_gusev
alexey_gusev
Flag of United Kingdom of Great Britain and Northern Ireland image

direct connection to mySql is definitely possible (personally I don't know how, but there are 3rd party products like this http://www.devart.com/dotconnect/mysql/download.html) - you might want to look for one that works on WinCE. I used DevArt components on WinMobile and it worked just fine, perhaps you could use the same on WinCE.

If your device is docked then you could use RAPI to read files on it from the desktop programmatically and then proceed as you described.

In general I'd say - develop a web service and connect to it directly from device, it's much easier than even ftp, which is not supported out of the box on WinCE devices.
Avatar of vlachosg
vlachosg

ASKER

just to clarify..  

what you mean is to create a web service in the debian box that will accept requests from the windows ce device?

That sounds quite interesting but

If yes what type of web service will be appropriate ? RESTFUL? SOAP?

Could you please explain a scenario that the device can send the data to the mysql and be able to validate that they where send correctly in terms of broken communication?

cheers
1) yes, I meant SOAP webservice, then WinCE can use wrapper class (created by VS when you specify web service's url) to communicate to it

2) I don't know all the details about comms to mySql, but since 3rd-party components do it hence I guess it is possible. As far as I understand they connect via tcpip to the server and then pass the data over it.

in case of web service you can return operation result and ensure the data is sent properly
1) I am not using VS I am using sharpdevelop so everything I ll do its going to be through sharpdevelop.

Is there any example of creating such a scenario just to see a bit of the code and decide being a newbie in c# wether I ll be able to go through with it.

2)I am intenting to build a php script that the windows ce will connect to it and send the data there..then php will do all the input to mysql so the windows ce wont have to deal with  mysql connections..


ASKER CERTIFIED SOLUTION
Avatar of alexey_gusev
alexey_gusev
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer