使用find查询判断
Else
Dim nms() As String = {"手机号","密码","注册日期","推广码"} '不能为空的列名数组
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) = False Then '生成错误提示页
With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return "" '必须返回
End If
Next
dim drr as datarow = DataTables("用户").find("手机号='" & e.PostValues("手机号") & "'")
if drr isnot nothing then
With wb.AddMsgPage("","msgpage","增加失败", "手机号已经注册!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return "" '必须返回
end if