Click here to Skip to main content
15,891,375 members
Articles / Database Development / SQL Server

Take Data Offline Using Microsoft Synchronization Services for ADO.NET

Rate me:
Please Sign up or sign in to vote.
4.88/5 (64 votes)
11 Jan 2008CPOL17 min read 385K   6.6K   252  
Build occasionally connected applications using Microsoft Synchronization Services for ADO.NET
OfflineAppDemo Sample Application

This application demonstrate how to build offline application using Synchrnoization Services for ADO.NET library
In this sample, two tables (orders, order_details) are at the server database and we would like to take the 
content offline and make some updates to client and server content then synchronize the changes.

What is demonstrated in this sample?
- 2-Teir sync scenario where client have direct access to server database through ADO connection object
- Setting up the server tables for bidirectional sync
- Using SqlSyncAdapterBuilder to create SyncAdapter for each table we want to sync
- Using SQLCE to cache content on the client 
- Showing sync progress

What is not demonstrated in this sample?
- N-Tier scenrio where the client connects to middle tear and does not have access to the server DB
- Handling Conflicts
- Manual creation of the SyncAdapter objects
- Creating custom schema on the server 
- Inspecting inflight DataSet (for any custom logic, auditting..etc)
 

How to install OfflineAppDemo application?

1- Fire SQL server and load demo.sql file
2- Execute the script untill the "test sample" marker

3- Load VS solution (OfflineAppDemo-Builder Project) 
4- Build the project 
5- You are ready to go


Notes
- The client db is not created until the first sync with the server there fore making any random operations will result in error message.



� 2007 Microsoft Corporation.  All rights reserved.  This OfflineApp Demo Sample Application (and all documentation, code and samples included with this application) is provided AS IS, WITHOUT WARRANTY OF ANY KIND, is for informational purposes only, and is subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Chief Technology Officer Raveable.com
United States United States
Entrepreneur, developer and then some. I started Raveable Hotel Reviews in 2008 to help travelers find the best hotel for their vacation with no history of bed bug reports (hint: don't go new york without checking bed bugs in NYC hotels page), cases of personal property theft, or food poisoning incidents.

Prior to Raveable.com, I was a development lead at Microsoft Corporation. I led the team developing the next generation social networking for Windows Mobile. Before that I played leading role in the design and development of Microsoft Sync Framework, Sync Services for ADO.NET, SQL Server Replication and Windows File Replication.

My Company: Raveable Hotel Reviews
My Sync Blog: The Synchronizer
My Sync WebSite: www.syncguru.com

Comments and Discussions