Welcome to MSDN Blogs Sign in | Join | Help

Sample - SQL Express Client Synchronization using Sync Services for ADO.NET

We have just posted a new sync sample to our Code Gallery that demonstrates how to enable offline data collection applications to synchronize a SQL Express client database to another SQL Server database using the Synchronization Services for ADO.NET library.  In this scenario, SQL Express client databases can be used as client databases to a central ADO.NET enabled database.  Unlike the existing peer-to-peer synchronization SQL Express provider sample which you may have seen, this sample is optimized for a hub-and-spoke topology.

In this sample, two tables (orders and order_details) are on the server database and also on the local client database.  The sample synchronizes edits to these table to keep their data identical.
This sample demonstrates:

  • Using SQL Express to cache changes for a client application.
  • A customized SQLExpressClientSyncProvider class that wraps around Microsoft.Synchronization.Data.Server.DbServerSyncProvider.

I would like to point out that even though we have done a fair amount of testing in house with this sample, it is still only posted as a sample.  In the future we certainly plan of including a fully supported version of a SQL Express client provider within a future release of Sync Services for ADO.NET. 

With that, we certainly want to hear your feedback on this sample and please feel free to post comments to our Sync Services for ADO.NET forum.

Liam Cavanagh

Published Tuesday, June 24, 2008 5:40 PM by liamca

Comments

# Announcing availability of a new Sync sample - SQL Express Client Synchronization using Sync Services for ADO.NET

Tuesday, June 24, 2008 4:06 PM by Mahjayar's WebLog.

We have released a new sample on our Sync code gallery site that demonstrates use of Sql Express database

# Announcing availability of a new Sync sample - SQL Express Client Synchronization using Sync Services for ADO.NET

Tuesday, June 24, 2008 4:06 PM by Mahjayar's WebLog.

We have released a new sample on our Sync code gallery site that demonstrates use of Sql Express database

# Sync Provider for SQL Express

Tuesday, June 24, 2008 11:00 PM by Kok Kiet's Blog

Microsoft has released Sync Framework couple months ago, enable offline data collection applications...

# SQL Express Client Synchronization

Tuesday, June 24, 2008 11:21 PM by Sergey Zwezdin

Пример еще одного из сценариев реализации синхронизации и offline-enabled прилож

# Cliente SQL Server Express para Sync Services para ADO.NET

Wednesday, June 25, 2008 5:34 AM by desarrolloMobile.NET

Acaban de anunciar, en el blog del equipo de desarrollo de MS Sync Framework , un ejemplo (en CodePlex

# SQL Express Client Sample seems to only work for Bidirection

Friday, August 01, 2008 5:45 PM by rgmust95

I am in the process of making an engine that will sync between sql 2008 server and sql 2008 express.

The sample has worked great ... but when i do "download only" it doesn't apply the changes.

It recognizes what to change.. it just doesn't apply them.

Any ideas??

Thanks,

Roger

# Problem updating changes from client to server DB after synchronizing

Thursday, November 06, 2008 4:54 AM by rajeshatexcelencia

Hi,

We are using SQL Express provider for ado.net sync to develop an application to sync between SQL Server 2005(server) and SQL Express 2005(client).

The scenario is as below:

1. We synchronize data from server to client (which loads a fresh set of data successfuly on client)

2. Now we change some rows on the client DB (updates) on the rows which were synchronized from the server DB.

3. Now when we try to synchronize the changes from the client Db to Server back, it gives us a primary key violation error as below:

Error Message:

Conflict detected while applying changes to the server.

Table: Orders.

Conflict Type: ClientInsertServerInsert.

Error: Violation of PRIMARY KEY Constraint ‘PK_orders_7c848OAE’. Cannot insert duplicate key in key in object ‘dbo.orders’.

The statement has been terminated.

Order_id:381.

The server row will not be updated.

Could anyone please tell us what could be wrong in this sql express adotpion, the same works when we use a SQL Ce on the client.

The original sample which we took from the link below also has this same issue:

http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=1200

Pls any help would be greatly appreciated

# re: Sample - SQL Express Client Synchronization using Sync Services for ADO.NET

Tuesday, May 05, 2009 7:55 AM by bdrajer

Hi guys,

We've been tinkering with the SQL Express Client Sync Provider, added support for DateTime anchors and possibly fixed a bug which mixes up client and server anchors. You may be interested to take a look at this:

http://www.8bit.rs/blog/?p=23

Anonymous comments are disabled
 
Page view tracker