Search code examples
frameworkssynchronizationmicrosoft-sync-framework

Sync Framework 2.1 - Deleted row information cannot be accessed through the row


I am trying to sync SQL express to a central SQL 2008 r2 database. When I delete a row in the central database and try to sync it to the express database with a download-only scope, it throws the below error:

Deleted row information cannot be accessed through the row.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.DeletedRowInaccessibleException: Deleted row information cannot be accessed through the row.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[DeletedRowInaccessibleException: Deleted row information cannot be accessed through the row.]
Microsoft.Synchronization.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics) +0

Solution

  • As mentioned in the comment I found the problem in the ChangesApplied event handler.

    Changed the code to access row values from table.Rows[i][j] to table.Rows[i][j, DataRowVersion.Original]

    to fix it.