以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助] 死循环了  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=151683)

--  作者:susanhe
--  发布时间:2020/6/30 20:55:00
--  [求助] 死循环了

你好, 这个代码在表属性中的Datacolchanging中, 一下运就会出现死循环了,哪儿出错了,请给看一下,麻烦了。


If e.DataCol.Name = "FPrioritized" Then
    Dim dr As DataRow
    dr = e.DataTable.Find("FPrioritized = \'" & e.NewValue & "\'")
    If dr IsNot Nothing Then
        If MessageBox.Show("已经重复了,是否要重新修改 ?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes Then
            e.DataRow("FPrioritized") = True
            dr("FPrioritized") = False
            dr("FNeg") = True
            e.Cancel = True
        End If
        e.DataRow("FPrioritized") = False
        dr("FNeg") = True
    End If
End If

--  作者:y2287958
--  发布时间:2020/6/30 21:00:00
--  
If e.DataCol.Name = "FPrioritized" Then
    Dim dr As DataRow
    dr = e.DataTable.Find("FPrioritized = \'" & e.NewValue & "\'")
    If dr IsNot Nothing Then
        If MessageBox.Show("已经重复了,是否要重新修改 ?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes Then
            e.DataRow("FPrioritized") = True
            dr("FPrioritized") = False
            dr("FNeg") = True
            e.Cancel = True
        End If
        e.DataRow("FPrioritized") = False
        dr("FNeg") = True
    End If
End If
反复修改,肯定死循环了

--  作者:有点蓝
--  发布时间:2020/6/30 21:46:00
--  
这代码想干嘛的?