Dim dt1 As DataTable = DataTables("总人口")
Dim dt2 As DataTable = DataTables("村级一览表")
For Each dr As DataRow In dt2.DataRows
Dim filter As String = ""
If dr("单位") = "合计" Then
filter = "单位名称 = '合计'"
Else
filter = "单位名称 = '" & dr("单位") & "' and 组名称 = '" & dr("组名称") & "'"
End If
Dim fdr As DataRow = dt1.Find(filter)
For Each dc As DataCol In dt2.DataCols
If dr.IsNull(dc.Name) Then
If fdr IsNot Nothing AndAlso fdr.IsNull(dc.Name) = False Then
dr(dc.Name) = fdr(dc.name)
End If
End If
Next
Next