是否可以使用 ado.net 的同步服务解决客户端冲突?例如,使用客户端插入服务器插入,更新客户端的表 ID(在客户端),tks
David Baiao
问问题
599 次
1 回答
0
在服务器端,您可以执行以下操作:
Partial Public Class NorthwindCacheServerSyncProvider
Private Sub ApplyChangeFailedEvent(…) Handles Me.ApplyChangeFailed
Dim clientChanges As DataTable = e.Conflict.ClientChange
Dim serverChanges As DataTable = e.Conflict.ServerChange
' Code to resolve conflict
If (clientChanges.Rows(0)("ModifiedDate") > _
serverChanges.Rows(0)("ModifiedDate") Then e.Action = ApplyAction.RetryWithForceWrite
End If
您不能在客户端上执行此操作,但是,您可以拦截应用更改事件并采取适当的措施,就像这样......
Partial Public Class NorthwindCacheClientSyncProvider
Private Sub ApplyingChangesEvent(…) Handles Me.ApplyingChanges
Dim clientChanges As DataSet = e.Changes
于 2010-02-13T21:25:15.280 回答