locked
Row filtering and composite keys RRS feed

  • Question

  • "Missing value for primary key 'user_id' in table 'UserMemberDownloaded'"

       at Microsoft.Synchronization.Data.SqlServerCe.SqlCeClientSyncProvider.ApplyDelete(SyncTableMetadata tableMetadata, UInt64 lastSentAnchorValue, DataRow dataRow, ApplyAction action, SqlCeException& error)
       at Microsoft.Synchronization.Data.SqlServerCe.SqlCeClientSyncProvider.ApplyDeletes(SyncTableMetadata tableMetadata, SyncTableProgress tableProgress, SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)
       at Microsoft.Synchronization.Data.SqlServerCe.SqlCeClientSyncProvider.ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)
       at Microsoft.Synchronization.SyncAgent.DownloadChanges(SyncGroupMetadata groupMetadata)
       at Microsoft.Synchronization.SyncAgent.Synchronize()

    I am getting the above exception while synchronizing between SQL Server 2008 and CE 3.5. I have six tables in my custom sync agent, 5 go through fine (i.e. without an error). The last one has a composite primary key (user_id and member_id). Based on the exception and the fact that I did not specfiy the primary key anywhere in the code, I am wondering if I can sync association tables with composite primary keys at all, or if I need to give the table its own primary key. Are composite keys supported? Or am I on the wrong track alltogether?
    • Moved by Hengzhe Li Friday, April 22, 2011 2:56 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, June 11, 2009 1:32 AM

Answers

  • I've had a look at my database. I found that I had some orders with no Orderdetails - note to self - better fix that.

    So I deleted the orders that contained no details... And primeworks completed the export to sdf ok.

    Don't know if that helps. But it may be worth checking
    Saturday, June 20, 2009 4:08 AM

All replies

  • I get the same sort of error. I'm using primeworks (a third party tool available from www.primeworks.com) to port my sql 2008 mdf to a sdf.
    The error occurs on the one table that has a composite key. The table orderdetails has ProductID and OrderNumber as a composite pair to uniquely identify each record.

    Sorry I don't have an answer but I am interested to see if sqlCE does actually support composite keys.. so I'll watch this space..
    Saturday, June 20, 2009 3:35 AM
  • I've had a look at my database. I found that I had some orders with no Orderdetails - note to self - better fix that.

    So I deleted the orders that contained no details... And primeworks completed the export to sdf ok.

    Don't know if that helps. But it may be worth checking
    Saturday, June 20, 2009 4:08 AM