For Each dr As DataRow In DataTables("答题数据1").datarows Dim fdr As DataRow = DataTables("客观题答案").find("客观题 = '" & dr("客观题") & "'") Dim ndr As DataRow = DataTables("成绩表").Find("学号 = '" & dr("学号") & "'") If ndr Is Nothing Then ndr = DataTables("成绩表").AddNew ndr("学号") = dr("学号") End If If fdr Is Nothing Then ndr("成绩1") = 0 Else ndr("成绩1") = 1 End If Next