I am using the VS2008 Local Data Cache tool to synchronize a SqlServer 2008 Db with a local SQL CE 3.5. At the server I have a table with a PK with datatype uniqueIdentifier
and defaultvalue newID()
. Upon initial synchronization through the Local Data Cache the DB it creates does not copy the default value for this column
(as described here: http://msdn.microsoft.com/en-us/library/bb726037%28v=SQL.105%29.aspx, See "..the following constraints are not copied to the client: FOREIGN KEY constraints, UNIQUE constraints, and DEFAULT constraints...")
I have found a similar question here: MS Sync Framework: Table schema not copied to local db.
But w开发者_Python百科hen I tried to implement the solution, I found that the CreatingSchema event for the clientSyncProvider of my Local Data Cache partial class does not fire.
How come? How do I change the schema for a local Data Cache?
Thanks for any ideas you can come up with.
what is the TableCreation option settings for your client database? if the SDF and the initial schema has been created by the Local Database Cache wizard, then subsequent syncs will no longer create the schema not unless you specify via the TableCreation option that the existing tables be dropped and replaced with a new schema.
精彩评论