Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Good Day, Please can some one help me out here!
I have a windows application and a web application with same database structure, Is it possible for my windows application to synchronize with my web application so that when ever i am connected to the internet, I will be able to download all the data on the remote server to my local machine, for the windows application....A very good example of what i am talking about is Microsoft Outlook..
My Application is on visual studio 10 and C#..

thanks and i do appreciate your lovely time..



thanks
Posted

If both applications are online all the time, then you could simply use the same connection string to the database. The problem will arise when your Windows application is unable to get online...

Your solution can either be letting the user know this Win application only works online, or have a separate embedded db with the same structure as your online db and download/upload the new content whenever it gets online.

Outlook achieves this through timestamps, emails have timestamps, so it's easy to know "Yes, this is a new email" so outlook goes ahead and downloads everything from the latest timestamp it knows.
 
Share this answer
 
Comments
Difameg Network Nigeria 6-Aug-13 8:34am    
The applications are not always online, but the windows application can come online to download the data in the remote computer and go offline to work on the datas..
Synchronization is what will work for me, but How?
onelopez 6-Aug-13 10:27am    
Take a look at this awesome article here at CP.

http://www.codeproject.com/Articles/17647/Disconnected-Client-Architecture

I didn't write it myself, so cheers to the author, but it's a great place to start.
Hi Difameg...,

I've had a similar issue previously in my project where we had 2 applications. One is a Web app and the other is a Windows app. Both of them use a same DB. Till that point, everything was fine. But later on, my client said that the Windows app would not be connecting to DB while at remote locations. Then, we looked into a concept called Synchronization of Database. This concept runs like this:

1. Web application will always work on MasterDB.
2. Windows application will work on PeerDB (same schema as MasterDB).
3. Initially, we synchronize both the MasterDb and PeerDB to make sure that they have same lookup data for login purpose, other static data, etc.
4. Now, Windows application would work on its own PeerDB for as long as they want to.
5. To get the data back into MasterDB, they would synchronize both the databases.

Now, you'll have all the data into MasterDB, as well as PeerDB for offline working.

Please do look into Microsoft Synchronization Framework 2.0v. This would solve most of your problems.

Thank you,
RelicV
 
Share this answer
 
Comments
Difameg Network Nigeria 6-Aug-13 8:33am    
Thank you RelicV, How Do i achieve that, do you have or know any tutorials where i can look into the sync aspect?
that is exactly what i am looking for?
RelicV 6-Aug-13 9:50am    
Please go through the following links.

1. Introduction to Microsoft Sync Framework. Its very clearly explained how it works with some example data.
http://msdn.microsoft.com/en-in/sync/bb821992.aspx

2. This is a MSDN link for sample tutorials.
http://msdn.microsoft.com/en-us/library/ff928494.aspx

Hope this helps you!
Good luck!
RelicV

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900