locked
How do you handle "Sync Framework does not automatically handle the deletion of rows that no longer satisfy a filter condition" RRS feed

  • Question

  • http://msdn.microsoft.com/en-us/library/dd918848.aspx

    "It is important to understand that a scope is the combination of tables and filters. For example, you could define a filtered scope named sales-WA that contains only the sales data for the state of Washington from the customer_sales table. If you define another filter on the same table, such as sales-OR, this is a different scope. If you define filters, be aware that Sync Framework does not automatically handle the deletion of rows that no longer satisfy a filter condition. For example, if a user or application updates a value in a column that is used for filtering, a row moves from one scope to another. The row is sent to the new scope that the row now belongs to, but the row is not deleted from the old scope. Your application must handle this situation."

    I am just wondering someone can shed some light on how to handle "Sync Framework does not automatically handle the deletion of rows that no longer satisfy a filter condition"?

    Many thanks. 


    Junhai Kan
    • Edited by Junhai Kan Thursday, December 8, 2011 5:37 AM
    Thursday, December 8, 2011 1:16 AM

All replies

  • which providers are you working with? is it all on SqlSyncProvider?
    Thursday, December 8, 2011 10:09 AM
  • which providers are you working with? is it all on SqlSyncProvider?


    SqlCeSyncProvider & SqlSyncProvider.

    thanks for your reply.


    Junhai Kan
    Friday, December 9, 2011 3:45 AM
  • you can handle it in several ways, one way is to do an delete and re-insert on the server instead of an update. the delete gets propagated to clients and they remove their rows. the inserts will make sure row gets downloaded by the new target clients.

    another way is to delete the out-of-scope rows in the client and intercept them in the ChangesSelected event and removing them from the change dataset so the the local deletes dont get uploaded.

    Saturday, December 10, 2011 10:59 AM