Solved

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

Posted on 2010-09-07
5
1,414 Views
Last Modified: 2013-12-21
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
0
Comment
Question by:vlachosg
  • 3
  • 2
5 Comments
 
LVL 24

Expert Comment

by:alexey_gusev
Comment Utility
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.
0
 

Author Comment

by:vlachosg
Comment Utility
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
0
 
LVL 24

Expert Comment

by:alexey_gusev
Comment Utility
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
0
 

Author Comment

by:vlachosg
Comment Utility
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..


0
 
LVL 24

Accepted Solution

by:
alexey_gusev earned 500 total points
Comment Utility
#2 is definitely possible, you can do it via Http POST from the device

#1 can be irrelevant if you implement #2; I don't remember if SharpDevelop creates SOAP wrappers for you, but since VS uses standard cf.net assemblies for soap stuff I reckon it shouldn't be a problem. Anyway, there was wsdl.exe somewhere in SDK so you could convert wsdl definition file into c# class(es).

re. creating web service part - I've always used VS for that. So if I were you I'd go with php first, then explorer other options
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Once again I push the limits of my phone.  An introduction to the Android Google Now Launcher.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now