locked
How to sync back deleted records RRS feed

  • Question

  • Hi all,

    I am doing a sync UploadAndDownload. I am modifying the change dataset on source to prevent record deletes(on source) when destination deletes the records. What I need now is, I want to send deleted records back to destination from the source. But the thing is no change recorded on the source and no change detected on sync. So the records does not sync back to destination.

    Appreciate your help on this.

    Thanks.

    Happy Coding.

    Regards,

    Jaliya 


    Jaliya Udagedara(MCPD,MCSD) http://www.jaliyaudagedara.blogspot.com

    Monday, April 22, 2013 5:51 AM

Answers

  • no easy way for that...

    best i could think of is not to remove them on changesselected, but intercept them on applyingchanges on the destination. when you intercept before they get applied, you can insert those deleted rows in another holding table, then remove it from the dataset so they dont get applied. if you want to re-send those deleted rows, do a dummy update of the table you're synching via a join to the holding table.

    Tuesday, April 23, 2013 1:06 PM
  • you can access the deleted row information like this:

    var deletedRow = yourDataRow("yourPKColumn", DataRowVersion.Original)

    in sync fx, you only have the PK for the deleted row.

    Wednesday, April 24, 2013 1:10 AM

All replies

  • Jaliya,

    can you elaborate more? which delete to you want to propagate? a bit confusing which source/destination you're referring to.

    cheers,

    junet

    Tuesday, April 23, 2013 10:54 AM
  • Dear June,

    Nice to see your reply. This is my requirement. In my destination there is a possibility that records can be deleted. But those deletes should not be cascaded to the source. For that I am manipulating change dataset in destination changes selected event. Now its working and destination deletes does not effect source. But now we don't have that deleted records in destination, I need sync them back from source. But that doesn't seem to happen. I saw one of your reply saying do a dummy update on source. I did it and then records synced back to destination. But again there is a problem, because I have to do the dummy update on all the rows. Because I can't find that

    particular records which were deleted on destination.

    Appreciate your input on this.

    Thanks.


    Jaliya Udagedara(MCPD,MCSD) http://www.jaliyaudagedara.blogspot.com

    Tuesday, April 23, 2013 12:30 PM
  • no easy way for that...

    best i could think of is not to remove them on changesselected, but intercept them on applyingchanges on the destination. when you intercept before they get applied, you can insert those deleted rows in another holding table, then remove it from the dataset so they dont get applied. if you want to re-send those deleted rows, do a dummy update of the table you're synching via a join to the holding table.

    Tuesday, April 23, 2013 1:06 PM
  • I tried that too. I can't keep deleted records in a temporary table, because I am getting a message I can't access rows which are marked as deleted in the data table.

    Jaliya Udagedara(MCPD,MCSD) http://www.jaliyaudagedara.blogspot.com

    Tuesday, April 23, 2013 1:35 PM
  • I handle a similar situation, in the end I don't actually delete the records,...I flag it as "retired"  and monitor that column when processing data.  
    Tuesday, April 23, 2013 1:55 PM
  • you can access the deleted row information like this:

    var deletedRow = yourDataRow("yourPKColumn", DataRowVersion.Original)

    in sync fx, you only have the PK for the deleted row.

    Wednesday, April 24, 2013 1:10 AM
  • JuneT,

    Thanks, it's working.


    Jaliya Udagedara(MCPD,MCSD) http://www.jaliyaudagedara.blogspot.com

    Wednesday, April 24, 2013 4:42 AM