Dim kgt1,kgt2,zgt1,zgt2 As Integer
Dim fdr1 As DataRow = DataTables("客观题答案").find("客观题1 = '" & e.DataRow("客观题1") & "' And 试卷号 = '" & DataTables("答题数据1").name & "'")
Dim fdr2 As DataRow = DataTables("客观题答案").find("客观题2 = '" & e.DataRow("客观题2") & "' And 试卷号 = '" & DataTables("答题数据1").name & "'")
Dim ndr As DataRow = DataTables("成绩表").Find("学号 = '" & e.DataRow("学号") & "'")
If ndr Is Nothing Then
ndr = DataTables("成绩表").AddNew
ndr("学号") = e.DataRow("学号")
End If
If fdr1 Is Nothing Then
kgt1 = 0
Else
kgt1= 1
End If
If fdr2 Is Nothing Then
kgt2 = 0
Else
kgt2= 1
End If
If e.DataRow("主观题1") = "t" Then
zgt1 = 1
Else
zgt1=0
End If
If e.DataRow("主观题2") = "t" Then
zgt2 = 1
Else
zgt2=0
End If '给相关列赋值
ndr("成绩1") = kgt1 + kgt2 + zgt1+ zgt2