Answered by:
Unable to create a SyncAdapter using SqlSyncAdapterBuilder...

Question
-
hi, when I try running a Demo IV: Offline Application - Conflict Handling, I get the following exception:
Unable to create a SyncAdapter using SqlSyncAdapterBuilder, because the keys in the base table and the corresponding tombstone table are different.
at Microsoft.Synchronization.Data.Server.DbSyncAdapterBuilder.ValidateTombstonePrimaryKeys()
at Microsoft.Synchronization.Data.Server.DbSyncAdapterBuilder.BuildCache(Boolean closeConnection, Boolean useColumnsForParameterNames)
at Microsoft.Synchronization.Data.Server.DbSyncAdapterBuilder.GetInsertCommand(DataRow dataRow, Boolean useColumnsForParameterNames)
at Microsoft.Synchronization.Data.Server.DbSyncAdapterBuilder.GetInsertCommand()
at Microsoft.Synchronization.Data.Server.DbSyncAdapterBuilder.BuildSyncAdapter()
at Microsoft.Synchronization.Data.Server.DbSyncAdapterBuilder.ToSyncAdapter()
at Microsoft.Synchronization.Data.Server.SqlSyncAdapterBuilder.ToSyncAdapter()
at SyncApplication.SyncForm.buttonSynchronize_Click(Object sender, EventArgs e) in D:\SwatiExamples\SynchronizationServicesIn3.5\Demo I Offline Application - SyncAdapterBuilder\OfflineAppDemo-Builder\app\SyncForm.cs:line 154
Any guidance appreciated.
Regards,
Swati- Moved by Max Wang_1983 Friday, April 22, 2011 6:06 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
Monday, June 25, 2007 11:01 AM
Answers
-
Swati,
The primary key on the base table must be the same as the primary key on your tombstone table. Have you verified that this is the case?
Sean Kelley
Program Manager
Microsoft
Friday, August 22, 2008 1:59 PMModerator
All replies
-
I don't know if this helps in your case, but... I was having trouble with the same error on my own project.
I found that the validation is case-sensitive fired during the ToSyncAdapter() method, regardless of SQL Server case sensitivity settings.
http://forums.microsoft.com/sync/ShowPost.aspx?PostID=3774876&SiteID=75Friday, August 22, 2008 10:48 AM -
Swati,
The primary key on the base table must be the same as the primary key on your tombstone table. Have you verified that this is the case?
Sean Kelley
Program Manager
Microsoft
Friday, August 22, 2008 1:59 PMModerator -
Solution to this problem is related to the fact that we perform case sensitive matches on the column names when comparing the PK on the primary table and the PK on the base table. See more info here:
http://forums.microsoft.com/sync/ShowPost.aspx?PostID=3774876&SiteID=75
Sean Kelley
Program Manager
Microsoft
Friday, August 22, 2008 2:03 PMModerator