views:

45

answers:

1

I'm fairly new to the MS Sync framework and have been beating my head against the wall for about four hours now to no avail. I'm simply trying to sync my databases (one "master" SQL Server 2008 with a SQL Server CE, the client) with:

Dim syncAgent As DataCacheSyncAgent = New DataCacheSyncAgent()
Dim syncStats As Microsoft.Synchronization.Data.SyncStatistics = syncAgent.Synchronize()

It works just fine in Visual Studio 2010 and always manages to sync, but now that I'm trying to implement it on my client's computers, I always get the error:

The specified change tracking operation is not supported. To carry out this operation on the table, disable the change tracking on the table, and enable the change tracking.

I've tried everything that I can think of to no avail, but like I said I'm new to the sync framework and haven't found much help on Google. I've tried turning change tracking off and back on (on the server via SQL Mgmt Studio), but that didn't work either. Perhaps it meant I should turn it off & back on in the client? How might I accomplish that programmaticly?

A: 

After much searching and beating my head against the wall, the fix was surprisingly simple. What needs to happen when this error occurs is to set your solution's .sdf Copy to Output Directory property to "Do not Copy" and delete the one that may already be in your data directory. The sync framework will then automatically build your database on first load. Pretty cool actually. I noticed this question A LOT on the web, but no real answers & the error description was anything but helpful, so I hope that this post helps someone. I'm still having one issue though, but I think that is best placed in another question.

coderpros