locked
Unable to create a SyncAdapter error - problem and solution RRS feed

  • Question

  •  

    I am just getting started with the Sync Framework and I had a problem right off the bat and I thought others might benefit from my experience.

     I decided to start by using the automtated methods of adding a new local database cache in VS 2008. Generally it worked pretty well except for one table. That table returns an error "Unable to create a SyncAdapter using SqlSyncAdapterBuilder, because the keys in the base table and the corresponding tombstone table are different."   (Of course I had to add tables a few at a time to finally identify the table that was causing the problem because the error message didn't tell me. )  Now that error message  would seem to be a pretty self-explanatory error except for two things: 1. The Configure Data Synchronization wizard built the tombstone table itself. 2.The primary key columns are identical.

     

    I tend to design all my tables with both a single column synthetic key and then I identify the column(s) that make up the alternate key and build a unique index on those column(s). In this case those columns were  varchar(10) and varchar(40) columns.  For some reason this alternate key index was causing the problem. The one thing I think was unique about this particular index (and I can't swear to it as I haven't checked all the others) is that it was clustered.  Once I deleted the index, I was able to use the wizard to add that table.

     

    So the moral of the story MIGHT be, don't used alternate unique CLUSTERED keys with the sync framework until after you set up the local databse.

     

    (BTW - many thanks to Daniel Moth and Liam Cavanagh for their excellent screencasts on how to get started with this stuff.)

    Tod

    • Moved by Max Wang_1983 Friday, April 22, 2011 6:07 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, April 10, 2008 12:35 AM

Answers