Controlling the anchor in the client DB RRS feed

  • Question


    Is there any way to control the anchor value of the client DB manually? The reason I am asking is that I want to force a re-sync of a whole table, but don't want to drop the table.



    • Moved by Max Wang_1983 Friday, April 22, 2011 8:52 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, January 31, 2008 1:28 PM

All replies


    first of all you should try to NOT reset the client anchor manually. doing so could cause data lose either on client or on server.


    the client provider exposes two public methods: getClientAncho() and SetClientAchor() which you can use to manuplate the anchor values.


    if you just want to resync all the data from the server, you can change the syncdirection of the table to snapshot to get all the data downloaded to the client. this should be a recommend way to refresh all you data on client. of course, you should delete the data on the table or you will see conflicts due to existing data in the table.




    Thursday, January 31, 2008 8:46 PM
  • Thanks for the suggestion, but the only way it works with the snapshot is if I set the creation option to drop the table which is what I do not want to do. Any other suggestions?

    Thursday, January 31, 2008 10:07 PM
  • you can surely use the other table creation options such as useExisting. you will deal with the existing rows in the table rhough if you choose this one. please let us know if this is the case.




    Friday, February 1, 2008 7:15 PM
  • Another good suggestion, but it still doesn't work for me. I will define my problem a little more.  The suggestions that I have received so far all work IF there has been a change in the database. If there are no changes then it does nothing. This is great except for when you change the filter options. If you change a filter and no data in the database has changed then it will not do a sync based on the new filters.


    This presents a problem because a filter change is not treated as a change. So when I am in downloadonly mode and I change the filter it does nothing, even if I delete every row on the client. It does nothing because when it compares the anchors, they still match. If I could change the anchor or delete the anchor then I could trick it into thinking there has been a change and then I could do a snapshot one time to get fresh data based on the new filters and go back to downloadonly every time after that.


    I have come to realize that I could just drop the table and all SYNC problems would be solved, but then a new world of problems show up. Even in the small amount of time that the Table would be gone, it would cause great pain to my clients. This is why I want to just change the anchor to minimize the amount of time that the table will be non-accessible.


    Keep the suggestions coming, they are great.


    Friday, February 1, 2008 7:33 PM