Share via


SqlCeClientSyncProvider.ApplyChanges Method (SyncGroupMetadata, DataSet, SyncSession)

Applies inserts, updates, and deletes for a synchronization group to the client database when given group metadata, a data set, and synchronization session parameters.

Namespace: Microsoft.Synchronization.Data.SqlServerCe
Assembly: Microsoft.Synchronization.Data.SqlServerCe (in microsoft.synchronization.data.sqlserverce.dll)

Syntax

'Declaration
Public Overrides Function ApplyChanges ( _
    groupMetadata As SyncGroupMetadata, _
    dataSet As DataSet, _
    syncSession As SyncSession _
) As SyncContext
public override SyncContext ApplyChanges (
    SyncGroupMetadata groupMetadata,
    DataSet dataSet,
    SyncSession syncSession
)
public:
virtual SyncContext^ ApplyChanges (
    SyncGroupMetadata^ groupMetadata, 
    DataSet^ dataSet, 
    SyncSession^ syncSession
) override
public SyncContext ApplyChanges (
    SyncGroupMetadata groupMetadata, 
    DataSet dataSet, 
    SyncSession syncSession
)
public override function ApplyChanges (
    groupMetadata : SyncGroupMetadata, 
    dataSet : DataSet, 
    syncSession : SyncSession
) : SyncContext

Parameters

  • groupMetadata
    A SyncGroupMetadata object that contains metadata about the synchronization group.
  • dataSet
    A DataSet object that contains the rows of data to be applied to the client database.
  • syncSession
    A SyncSession object that contains metadata about the current synchronization session.

Return Value

A SyncContext object that contains data changes and anchor values and other metadata for a synchronization session.

Remarks

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.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements (Synchronization Services).

Target Platforms

See Also

Reference

SqlCeClientSyncProvider Class
SqlCeClientSyncProvider Members
Microsoft.Synchronization.Data.SqlServerCe Namespace