Fortunately Microsoft has released this kind of framework which is called Microsoft Sync Framework. This enables the developers to build applications with the ability to sync the files in file system, table records in the database between two machines.
For more details on microsoft sync framework please read the following.
- Sync Framework Overview
- Introduction to Occasionally Connected Database Synchronization
- Introduction to File Synchronization