URGENT: Upload End for each table RRS feed

  • Question

  • Hi


    I am using Sync Framework, in order to synchronize between a server db(sql server 2005 ) and a CE db on a device, running windows mobile 6.

    I'm using VS 2008 c# to create the WCF, WS and the deivce application.

    I have 3 types of Sync: Bidirectional, UploadOnly and DownloadOnly.


    1. I have a procedure that to run after the completition of the insert , update and delete processes to the server db, for each table.

    I found two different ways to do it. But honestly I feel like there is a better way.


    I can  run the procedure from the "InsertCommand", "UpdateCommand" and "DeleteCommand" of the syncadapter for each table.In this case, I will be running the procedure more than once, which might delay the  synchronization process in general.


    I can  check in the "OnSyncProgress" event, whenever the SynStage is "ApplyingInserts" or "ApplyingDeletes" or "ApplyingUpdates" for this table, I run the corresponding proceudre for this table.



    2. In the download process(server to device), I want it to try to update the record, and if it fails , it will insert it as a new record.I found it simple because all I had to do was taking off the "SelectIncrementalInsertsCommand" from the syncadapter of the table and modify the restriction of the "SelectIncrementUpdatesCommand".

    It seems that the default behavior of the  update is trying to update the record first, and then if it fails, it is inserting it.

    Am I right? or did it happen by chance?



    I really appreciate any suggestions on any of these 2 points .

    Thanks in advance. 



    • Moved by Max Wang_1983 Thursday, April 21, 2011 9:58 PM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Wednesday, July 30, 2008 3:55 AM