ADO.NET Sync Services Question
Hi,
I have an app that uses ADO.NET and an SQL Connection to update a very simple users Db.
I recently tried to add Sync Services functionality to my app.
I added a Local Data Cache.sync file to my app and configured it to point at my remote sql server and the new local SQL CE Db that it creates. When adding this Local Data Cache file to my app it also included some SQL scripts used during synchronization.
I changed my code to allow it to work with the local SQL CE DB using the auto generated SQL CE conn string, and when I run my app this local Db now gets updated when manipulating data. This all works.
The issue I am having is that I can for the life of me get the local CE Db to sync with the main SQL Svr Db, the code runs fine, but the stats always return 0 updates and the master sql db never gets updated.
When I add the MyLocalDataCache.sync file to the app the following classes are auto generated:
- MyLocalDataCacheSyncAgent
MyLocalDataCacheServerSyncProvider
MyLocalDataCacheClientSyncProvider
The Db, MyDataBaseName.sdf, also gets created.
The code I am using to sync is:
Code:
Public Sub Sync()
Dim syncAgent As MyLocalDataCacheSyncAgent = new MyLocalDataCacheSyncAgent()
Dim remoteProv As MyLocalDataCacheServerSyncProvider = new MyLocalDataCacheServerSyncProvider()
Dim localProv As MyLocalDataCacheClientSyncProvider = new MyLocalDataCacheClientSyncProvider()
syncAgent.RemoteProvider = remoteProv
syncAgent.LocalProvider = localProv
Dim syncStats As Microsoft.Synchronization.Data.SyncStatistics = syncAgent.Synchronize()
End Sub
I have tried the above code with the addition of passing conn strings for both remote and local Dbs, and passing these into the constructors of the server and client providers.
I know I am doing something daft here...but what? :(
Any ideas?
Woka