Sdílet prostřednictvím


SyncAdapter.SelectConflictDeletedRowsCommand Property

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

Namespace: Microsoft.Synchronization.Data.Server
Assembly: Microsoft.Synchronization.Data.Server (in microsoft.synchronization.data.server.dll)

Syntax

'Declaration
Public Property SelectConflictDeletedRowsCommand As IDbCommand
'Usage
Dim instance As SyncAdapter
Dim value As IDbCommand

value = instance.SelectConflictDeletedRowsCommand

instance.SelectConflictDeletedRowsCommand = value
public IDbCommand SelectConflictDeletedRowsCommand { get; set; }
public:
property IDbCommand^ SelectConflictDeletedRowsCommand {
    IDbCommand^ get ();
    void set (IDbCommand^ value);
}
/** @property */
public IDbCommand get_SelectConflictDeletedRowsCommand ()

/** @property */
public void set_SelectConflictDeletedRowsCommand (IDbCommand value)
public function get SelectConflictDeletedRowsCommand () : IDbCommand

public function set SelectConflictDeletedRowsCommand (value : IDbCommand)

Property Value

An IDbCommand object that contains a query or stored procedure.

Remarks

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 SelectConflictDeletedRowsCommand selects conflicting rows from the tombstone table in the server database. Sync Framework executes this command if the conflicting row was not found in the base table. This command selects the rows for the ClientUpdateServerDelete conflict.

Example

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

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

See Also

Reference

SyncAdapter Class
SyncAdapter Members
Microsoft.Synchronization.Data.Server Namespace