Solved

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

Posted on 2010-09-07
5
1,430 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
ID: 33624241
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
ID: 33628546
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
ID: 33628628
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
ID: 33628819
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
ID: 33628886
#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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Receiving a string from a WebService Push 21 36
C# Single Form 8 26
updating the date data 12 20
sql_mode 1 17
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Once again I push the limits of my phone.  An introduction to the Android Google Now Launcher.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

919 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

18 Experts available now in Live!

Get 1:1 Help Now