SqlCeClientSyncProvider.ApplyChanges Method (String, DataSet, SyncAnchor)

Applies inserts, updates, and deletes for a synchronization group to the client database when given a table name, a data set, and server anchor parameters.

Namespace:  Microsoft.Synchronization.Data.SqlServerCe
Assembly:  Microsoft.Synchronization.Data.SqlServerCe (in Microsoft.Synchronization.Data.SqlServerCe.dll)


Public Function ApplyChanges ( _
    tableName As String, _
    dataSet As DataSet, _
    serverAnchor As SyncAnchor _
) As SyncContext
Dim instance As SqlCeClientSyncProvider
Dim tableName As String
Dim dataSet As DataSet
Dim serverAnchor As SyncAnchor
Dim returnValue As SyncContext

returnValue = instance.ApplyChanges(tableName, _
    dataSet, serverAnchor)
public SyncContext ApplyChanges(
    string tableName,
    DataSet dataSet,
    SyncAnchor serverAnchor
SyncContext^ ApplyChanges(
    String^ tableName, 
    DataSet^ dataSet, 
    SyncAnchor^ serverAnchor
member ApplyChanges : 
        tableName:string * 
        dataSet:DataSet * 
        serverAnchor:SyncAnchor -> SyncContext 
public function ApplyChanges(
    tableName : String, 
    dataSet : DataSet, 
    serverAnchor : SyncAnchor
) : SyncContext


  • tableName
    Type: System.String
    A table in the client database for which to apply changes.

Return Value

Type: Microsoft.Synchronization.Data.SyncContext
A SyncContext object that contains data changes and anchor values and other metadata for a synchronization session.


Exception Condition

tableName or dataSet is a null reference (Nothing in Visual Basic).


Another transaction is in progress.


This method assumes that the table is in the client database; otherwise, the method throws an exception. If the table exists but tracking is not enabled, bidirectional tracking is enabled. Rows are marked with a DataRowState value to differentiate between inserts, updates, and deletes.

Changes are applied in the following order: deletes, inserts, and then updates. The order in which changes are applied to each table in a synchronization group depends on the order in which tables are added to the group. Deletes are applied in reverse of the order in which the tables are added. Inserts and updates are applied in the order in which the tables are added.

For example, if you add the table SalesOrderHeader and then add SalesOrderDetail to the same synchronization group, the following processing order is used during synchronization:

  1. Deletes are applied to SalesOrderDetail and then SalesOrderHeader.

  2. Inserts are applied to SalesOrderHeader and then SalesOrderDetail.

  3. Updates are applied to SalesOrderHeader and then SalesOrderDetail.

See Also


SqlCeClientSyncProvider Class

ApplyChanges Overload

Microsoft.Synchronization.Data.SqlServerCe Namespace