SyncAdapter.SelectConflictUpdatedRowsCommand Property

Synchronization Services - ADO.NET 1.0 SP1

Gets or sets the query or stored procedure that is used to identify updated rows that conflict with other changes.

Namespace: Microsoft.Synchronization.Data.Server
Assembly: Microsoft.Synchronization.Data.Server (in

Public Property SelectConflictUpdatedRowsCommand As IDbCommand
Dim instance As SyncAdapter
Dim value As IDbCommand

value = instance.SelectConflictUpdatedRowsCommand

instance.SelectConflictUpdatedRowsCommand = value
/** @property */
public IDbCommand get_SelectConflictUpdatedRowsCommand ()

/** @property */
public void set_SelectConflictUpdatedRowsCommand (IDbCommand value)

public function get SelectConflictUpdatedRowsCommand () : IDbCommand

public function set SelectConflictUpdatedRowsCommand (value : IDbCommand)

Property Value

An IDbCommand object that contains a query or stored procedure.

Synchronization adapter commands enable you to specify the queries and stored procedures that are used to select from and apply changes to the server database. For more information, see How to: Specify Snapshot, Download, Upload, and Bidirectional Synchronization. The query or stored procedure that you specify for the SelectConflictUpdatedRowsCommand property selects conflicting rows from the base table in the server database. Sync Services executes this command if an insert, update, or delete operation returns a @sync_row_count value of 0. This value indicates that the operation failed. This command selects the rows for ClientInsertServerInsert, ClientUpdateServerUpdate, and ClientDeleteServerUpdate conflicts.

The following code example creates a command that selects conflicting rows from the Customer table. To view this code in the context of a complete example, see How to: Handle Data Conflicts and Errors.

Dim customerUpdateConflicts As New SqlCommand()
With customerUpdateConflicts
    .CommandText = _
        "SELECT CustomerId, CustomerName, SalesPerson, CustomerType " _
      & "FROM Sales.Customer " + "WHERE CustomerId = @CustomerId"
    .Parameters.Add("@CustomerId", SqlDbType.UniqueIdentifier)
    .Connection = serverConn
End With
customerSyncAdapter.SelectConflictUpdatedRowsCommand = customerUpdateConflicts