先使用find查询一下,没有再新增:
http://www.foxtable.com/webhelp/topics/0396.htm
……
For Each dr1 As DataRow In DataTables("分村统计表").Select("[乡镇] IS NOT NULL")
Dim dr2 As DataRow = DataTables("分村统计表2").find(“乡镇='" & dr1("乡镇") & "' and 行政村='" & dr1("行政村") & "')
if dr2 is nothing then dr2 = DataTables("分村统计表2").AddNew()
For i As Integer = 0 To Cols1.Length - 1
dr2(Cols2(i)) = dr1(Cols1(i))
Next
……