以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 关于数据同步 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=92852) |
-- 作者:cxj1988mmx -- 发布时间:2016/11/15 10:38:00 -- 关于数据同步 DataRowDeleting 中增加 Dim msg As String = "D#" & e.DataTable.Name & "#" & e.DataRow("_Identify") For Each bd As QQBuddy In QQClient.Buddies If bd.Online Then \'MessageBox.show(bd.name & " : " & msg) QQClient.Send(bd.name, msg) End If Next 在ReceivedMessage 中用 Dim msg As String = e.Message If msg.StartsWith("D#") Then \'表示删除了行 Dim pts() As String = msg.Split("#") If pts.Length = 3 Then If DataTables.Contains(pts(1)) = True Then \'如果表加载 Dim dr As DataRow = DataTables(pts(1)).Find("[_Identify] = " & pts(2)) If dr IsNot Nothing Then DataTables(pts(1)).RemoveFor("[_Identify] = " & pts(2)) \'移除行 End If End If End If End If 用以上代码设计出问题,通过系统菜单删除无法同步,但是单独加个控件用以下代码,却能正常同步,不知道什么原因 If Tables("库存表").Current IsNot Nothing Dim Result As DialogResult Result = MessageBox.Show("是否删除选定行", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result = DialogResult.Yes Then Dim r As Row = Tables("库存表").Current Dim msg As String = "D#" & "库存表" & "#" & r("_Identify") r.Delete() Tables("库存表").Save() For Each bd As QQBuddy In QQClient.Buddies If bd.Online Then QQClient.Send(bd.name, msg) End If Next End If End If |
-- 作者:有点青 -- 发布时间:2016/11/15 11:24:00 -- 在事件代码里面加入msgbox,看是否进入执行了对应的代码。 |