我测试没问题
Dim kmdr As DataRow = DataTables("客观问题描述").find("试卷号= '" & DataTables("卷1答").Name.chars(1) & "'")
Dim kfdr As DataRow = DataTables("客观题答案").find("试卷号 = '" & DataTables("卷1答").Name.chars(1) & "'" )
Dim kgtfwdr As DataRow = DataTables("学生问题频度").find("学号 = '" & e.DataRow("学号") & "'")
Dim kegtdr1 As String = e.DataRow("客观题1")
Dim kegtdadr1 As String = kfdr("客观题1")
kgtfwdr("知1") = Nothing
kgtfwdr("知2") = Nothing
kgtfwdr("知3") = Nothing
kgtfwdr("知4") = Nothing
If e.DataRow("客观题1") IsNot Nothing Then
If kegtdr1.contains("a") = True And kegtdadr1.contains("a") = True
Else If kegtdr1.contains("a") = True Or kegtdadr1.contains("a") = True Then
Select Case kmdr("第1题A范")
Case "知1"
kgtfwdr("知1") = 1
Case "知2"
kgtfwdr("知2") = 1
Case "知3"
kgtfwdr("知3") = 1
Case "知4"
kgtfwdr("知4") = 1
End Select
End If
If kegtdr1.contains("b") = True And kegtdadr1.contains("b") = True
Else If kegtdr1.contains("b") = True Or kegtdadr1.contains("b") = True Then
Select Case kmdr("第1题B范")
Case "知1"
kgtfwdr("知1") = kgtfwdr("知1") + 1
Case "知2"
kgtfwdr("知2") = kgtfwdr("知2") + 1
Case "知3"
kgtfwdr("知3") = kgtfwdr("知3") + 1
Case "知4"
kgtfwdr("知4") = kgtfwdr("知4") + 1
End Select
End If
If kegtdr1.contains("c") = True And kegtdadr1.contains("c") = True
Else If kegtdr1.contains("c") = True Or kegtdadr1.contains("c") = True Then
Select Case kmdr("第1题C范")
Case "知1"
kgtfwdr("知1") = kgtfwdr("知1") + 1
Case "知2"
kgtfwdr("知2") = kgtfwdr("知2") + 1
Case "知3"
kgtfwdr("知3") = kgtfwdr("知3") + 1
Case "知4"
kgtfwdr("知4") = kgtfwdr("知4") + 1
End Select
End If
If kegtdr1.contains("d") = True And kegtdadr1.contains("d") = True
Else If kegtdr1.contains("d") = True Or kegtdadr1.contains("d") = True Then
Select Case kmdr("第1题D范")
Case "知1"
kgtfwdr("知1") = kgtfwdr("知1") + 1
Case "知2"
kgtfwdr("知2") = kgtfwdr("知2") + 1
Case "知3"
kgtfwdr("知3") = kgtfwdr("知3") + 1
Case "知4"
kgtfwdr("知4") = kgtfwdr("知4") + 1
End Select
End If
End If
Dim kegtdr2 As String = e.DataRow("客观题2")
Dim kegtdadr2 As String = kfdr("客观题2")
If e.DataRow.Isnull("客观题2") Then
Else If kfdr("客观题2") IsNot Nothing Then
If kegtdr2.contains("a") = True And kegtdadr2.contains("a") = True
Else If kegtdr2.contains("a") = True OrElse kegtdadr2.contains("a") = True Then
Select Case kmdr("第2题A范")
Case "知1"
kgtfwdr("知1") = kgtfwdr("知1") + 1
Case "知2"
kgtfwdr("知2") = kgtfwdr("知2") + 1
Case "知3"
kgtfwdr("知3") = kgtfwdr("知3") + 1
Case "知4"
kgtfwdr("知4") = kgtfwdr("知4") + 1
End Select
End If
If kegtdr2.contains("b") = True And kegtdadr2.contains("b") = True
Else If kegtdr2.contains("b") = True OrElse kegtdadr2.contains("b") = True Then
Select Case kmdr("第2题B范")
Case "知1"
kgtfwdr("知1") = kgtfwdr("知1") + 1
Case "知2"
kgtfwdr("知2") = kgtfwdr("知2") + 1
Case "知3"
kgtfwdr("知3") = kgtfwdr("知3") + 1
Case "知4"
kgtfwdr("知4") = kgtfwdr("知4") + 1
End Select
End If
If kegtdr2.contains("c") = True And kegtdadr2.contains("c") = True
Else If kegtdr2.contains("c") = True OrElse kegtdadr2.contains("c") = True Then
Select Case kmdr("第2题C范")
Case "知1"
kgtfwdr("知1") = kgtfwdr("知1") + 1
Case "知2"
kgtfwdr("知2") = kgtfwdr("知2") + 1
Case "知3"
kgtfwdr("知3") = kgtfwdr("知3") + 1
Case "知4"
kgtfwdr("知4") = kgtfwdr("知4") + 1
End Select
End If
If kegtdr2.contains("d") = True And kegtdadr2.contains("d") = True
Else If kegtdr2.contains("d") = True OrElse kegtdadr2.contains("d") = True Then
Select Case kmdr("第2题D范")
Case "知1"
kgtfwdr("知1") = kgtfwdr("知1") + 1
Case "知2"
kgtfwdr("知2") = kgtfwdr("知2") + 1
Case "知3"
kgtfwdr("知3") = kgtfwdr("知3") + 1
Case "知4"
kgtfwdr("知4") = kgtfwdr("知4") + 1
End Select
End If
End If
If e.DataRow.IsNull("客观题1") And e.DataRow.IsNull("客观题2") Then
kgtfwdr("知1") = Nothing
kgtfwdr("知2") = Nothing
kgtfwdr("知3") = Nothing
kgtfwdr("知4") = Nothing
End If