locked
Obtain primary key for rows that were deleted on server when updating client RRS feed

  • Question

  • In the applying changes event for the local provider, I am comparing data in records in the change dataset to data in records in the client to determine which changes are propagated from the server to the client.  I can do this for modif most  rows since I have the data for each row if RowState not equal to DataRowState.deleted in DbApplyingChangesEventArgs.Dataset.  However, for rows with RowState == DataRowState.Deleted, the row in  DbApplyingChangesEventArgs.Dataset is empty.  How can I determine the primary key for rows that with RowState == DataRowState.Deleted in  DbApplyingChangesEventArgs.Dataset (that is, how does the sync framework know which row to delete in the client database)


    Howard P. Weiss

    Friday, March 27, 2015 8:23 PM

Answers

  • try: 

    yourDataRow["theColumnYourAfter", DataRowVersion.Original]

    • Marked as answer by hpweiss Tuesday, April 14, 2015 1:09 PM
    Tuesday, April 14, 2015 8:06 AM

All replies

  • you should use the DbApplyChangesEventArgs.Context 
    Monday, April 13, 2015 8:06 AM
  • June -

    Thank you for responding so quickly.  I do not see how to use the context for this purpose.  If I try to read the information directly from the datatable, the item array for the deleted rows is empty so I cannot see the Primary as in the following list of row states and primary keys

    row 0 state Modified  A1JYB170E9002 80714
    row 1 state Modified  A1JYB170EDE04 80714
    row 2 state Modified  A1JYB170EGH05 80714
    row 3 state Modified  A1JYB170EHZ06 80714
    row 4 state Modified  A1JYB190ERR02 80714
    row 5 state Modified  A1JZ1260ZHZ01 Howard
    row 6 state Modified  A1JZ127138Z02 Howard
    row 7 state Modified  A1JZ12713P603 Howard
    row 8 state Modified  A1JZ12714J604 Howard
    row 9 state Modified  A1JZ12715GZ05 Howard
    row 10 state Modified  A1JZ12715NP06 Howard
    row 11 state Modified  A1JZ1271K6Y01 Howard
    row 12 state Modified  A1JZ30201110F 200199
    row 13 state Modified  A1JZ30201UF0E 200199
    row 14 state Modified  A1JZ3020R1W05 200199
    row 15 state Modified  A1JZ3020RGI06 200199
    row 16 state Modified  A1JZ3020RM107 200199
    row 17 state Modified  A1JZ3020UWJ09 200199
    row 18 state Modified  A1JZ3020V500A 200199
    row 19 state Modified  A1JZ3020V8O0B 200199
    row 20 state Modified  A1JZ3020VFH0C 200199
    row 21 state Modified  A1JZ302113J0G 200199
    row 22 state Modified  A1JZ302119Z0H 200199
    row 23 state Modified  A1JZ30212U30I 200199
    row 24 state Modified  A1JZ302138O0J 200199
    row 25 state Modified  A1JZ30213A10K 200199
    row 26 state Modified  A1JZ30213MM0L 200199
    row 27 state Modified  A1JZ30213U30M 200199
    row 28 state Deleted
    row 29 state Deleted
    row 30 state Added  A1JZ41014E301 Howard
    row 31 state Modified  H1JSB1001380G 45527
    row 32 state Modified  H1JSB1012XT0F 45527
    row 33 state Modified  H1JSB1013490H 45527
    row 34 state Modified  H1JSB1013BL0J 45527

    Howard Weiss


    Howard P. Weiss

    Monday, April 13, 2015 4:24 PM
  • I need to know which rows were deleted because we also maintain files whose contents must correspond to the information in the database. When a row is deleted from the database, I need to delete the corresponding file


    Howard P. Weiss

    Monday, April 13, 2015 10:16 PM
  • try: 

    yourDataRow["theColumnYourAfter", DataRowVersion.Original]

    • Marked as answer by hpweiss Tuesday, April 14, 2015 1:09 PM
    Tuesday, April 14, 2015 8:06 AM