是否可以使用ado.net的同步服务解决客户端的冲突? 例如,使用客户端插入服务器插入,更新客户端的表ID(在客户端),tks
答案 0 :(得分: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