如果写在datacolchanging事件,改成
if e.datacol.name = "新手机号码" then
if e.newvalue isnot nothing then
dim s1 as string = e.datarow("旧手机号码" )
dim s2 as string = e.newvalue
if s1 = s2
e.cancel = true
messagebox.show("手机号码重复")
end if