DataTables("生态补偿").ResumeRedraw DataTables("生态补偿").StopRedraw DataTables("生态补偿").DataRows.Clear Dim Cols1() As String = {"户主姓名", "身份证号","家庭人口"} Dim Cols2() As String = {"户主姓名", "户主证件号码","人数"} For Each dr As DataRow In DataTables("贫困户").Select("") Dim fdr As DataRow = DataTables("生态补偿").find("身份证号 = '" & dr("户主证件号码") & "'") If fdr Is Nothing fdr = DataTables("生态补偿").AddNew() End If For i As Integer = 0 To Cols1.Length -1 fdr(Cols1(i)) = dr(Cols2(i)) Next Next Dim Cols3() As String = {"户主姓名", "身份证号","县"} Dim Cols4() As String = {"姓名", "身份证号","县"} For Each dr As DataRow In DataTables("公益林").Select("") Dim fdr As DataRow = DataTables("生态补偿").find("身份证号 = '" & dr("身份证号") & "'") If fdr Is Nothing fdr = DataTables("生态补偿").AddNew() End If For i As Integer = 0 To Cols1.Length -1 fdr(Cols3(i)) = dr(Cols4(i)) Next Next DataTables("生态补偿").ResumeRedraw
|