SyncAdapter.SelectConflictDeletedRowsCommand 属性

获取或设置查询或存储过程,用于标识与其他变更相冲突的已删除行。

命名空间: Microsoft.Synchronization.Data.Server
程序集: Microsoft.Synchronization.Data.Server(在 microsoft.synchronization.data.server.dll 中)

语法

声明
Public Property SelectConflictDeletedRowsCommand As IDbCommand
用法
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)

属性值

包含查询或存储过程的 IDbCommand 对象。

备注

使用同步适配器命令可以指定用于从服务器数据库中选择变更和向服务器数据库应用变更的查询和存储过程。有关更多信息,请参见如何指定快照同步、下载同步、上载同步和双向同步。为 SelectConflictDeletedRowsCommand 指定的查询或存储过程可从服务器数据库的逻辑删除表中选择发生冲突的行。如果未在基表中找到存在冲突的行,则 Sync Framework 将执行此命令。此命令可为 ClientUpdateServerDelete 冲突选择行。

示例

下面的代码示例创建一个命令,该命令可从 Customer_Tombstone 表中选择发生冲突的行。若要在完整示例上下文中查看此代码,请参见如何处理数据冲突和错误

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

请参阅

参考

SyncAdapter 类
SyncAdapter 成员
Microsoft.Synchronization.Data.Server 命名空间