SqlCeClientSyncProvider.ApplyChanges Method (Generic IEnumerable, DataSet, SyncAnchor)
Applies inserts, updates, and deletes for a synchronization group to the client database when given table names, a data set, and server anchor parameters.
Namespace: Microsoft.Synchronization.Data.SqlServerCe
Assembly: Microsoft.Synchronization.Data.SqlServerCe (in microsoft.synchronization.data.sqlserverce.dll)
Syntax
'Declaration
<SuppressMessageAttribute("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")> _
Public Function ApplyChanges ( _
tableNames As IEnumerable(Of String), _
dataSet As DataSet, _
serverAnchor As SyncAnchor _
) As SyncContext
'Usage
Dim instance As SqlCeClientSyncProvider
Dim tableNames As IEnumerable(Of String)
Dim dataSet As DataSet
Dim serverAnchor As SyncAnchor
Dim returnValue As SyncContext
returnValue = instance.ApplyChanges(tableNames, dataSet, serverAnchor)
[SuppressMessageAttribute("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")]
public SyncContext ApplyChanges (
IEnumerable<string> tableNames,
DataSet dataSet,
SyncAnchor serverAnchor
)
[SuppressMessageAttribute(L"Microsoft.Naming", L"CA1702:CompoundWordsShouldBeCasedCorrectly")]
public:
SyncContext^ ApplyChanges (
IEnumerable<String^>^ tableNames,
DataSet^ dataSet,
SyncAnchor^ serverAnchor
)
/** @attribute SuppressMessageAttribute("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly") */
public SyncContext ApplyChanges (
IEnumerable<String> tableNames,
DataSet dataSet,
SyncAnchor serverAnchor
)
SuppressMessageAttribute("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")
public function ApplyChanges (
tableNames : IEnumerable<String>,
dataSet : DataSet,
serverAnchor : SyncAnchor
) : SyncContext
Parameters
- tableNames
A collection of tables in the client database for which to apply changes.
- dataSet
A DataSet object that contains the rows of data to be applied to the database.
- serverAnchor
A SyncAnchor object that represents the NewAnchor value for this 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 DataRowState 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:
Deletes are applied to SalesOrderDetail and then SalesOrderHeader.
Inserts are applied to SalesOrderHeader and then SalesOrderDetail.
Updates are applied to SalesOrderHeader and then SalesOrderDetail.
See Also
Reference
SqlCeClientSyncProvider Class
SqlCeClientSyncProvider Members
Microsoft.Synchronization.Data.SqlServerCe Namespace