Question

I have a situation that requires two SQL Compact edition databases to synchronise with each other using Microsoft Sync Framework in a C# 4 Winforms app, but I am struggling to find a way to get this to happen.

I have it working easily enough in a 2 tier type scenario, with SqlCeSyncProvider connecting directly to the server database, but am unsure about how to go about getting that to happen over WCF.

The samples I have seen from Microsoft are basically delegating to a SqlSyncProvider inside the WCF service, but the SqlCeSyncProvider doesn't appear to expose the same methods as the ServerSyncProviderProxy.

I could use a SqlCeClientSyncProvider inside the service (which is referred to in this question: Using MS Sync Framework to synchronize two SQL CE Dbs), but SqlCeClientSyncProvider does not expose GetSchema or GetServerInfo methods. I don't know if I can safely ignore those methods or not.

Are people just exposing the SQLCe databases over the network and using SqlCeSyncProvider or am I missing something that makes this work?

Was it helpful?

Solution

the SqlCeClientSyncProvider/SyncAgent combo doesnt support synching between SqlCe databases not unless you want to write your own DbServerSyncProvider that uses Sql Ce.

use SqlCeSyncProvider instead.

you can find a sample here: Database Sync: SQL Server and SQL Compact N-Tier with WCF

just modify it so both endpoints are Sql Ce

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top