以下是引用有点甜在2018/8/16 16:20:00的发言:
1、
Dim t As Table = e.Form.controls("table1").Table
Dim ls As object = t.GetCheckedRows
If ls.count = 0 Then ls = t.Rows
Dim dt As DataTable = DataTables("表A")
For Each r As Row In ls
Dim dr As DataRow = dt.find("身份证号='" & r("身份证号") & "'")
If dr Is Nothing Then
Dim d As Double
If Double.TryParse(r("年龄"),d) = False Then
r.DataRow.SetError("年龄", "不是数字")
Else
dr = dt.AddNew()
For Each dc As Col In t.Cols
If dt.DataCols.Contains(dc.name) Then
dr(dc.Name) = r(dc.name)
End If
Next
End If
End If
Next
msgbox("合并完成")
2、动态添加一列,如果出错的,标记一下,最后你可以根据标记列筛选出数据
http://www.foxtable.com/webhelp/scr/1428.htm
老师,对于上面的验证,性别只能是男和女,且不能为空,该如何实现呀?