If e.DataCol.Name = "学号" Then
If e.NewValue Is Nothing Then
e.DataRow("姓名") = Nothing
Else
Dim dr As DataRow
Dim d1 As DataRow
dr = DataTables("成绩详细").Find("[学号] = '" & e.NewValue & "'")
d1 = DataTables("成绩详细").Find("[学号] = '" & e.NewValue & "'" And "[年级编号] = '41'")
If dr IsNot Nothing Then
e.DataRow("姓名") = dr("姓名")
e.DataRow("班级") = dr("班级")
e.DataRow("学院") = dr("学院")
e.DataRow("大一成绩") = d1("总分")
End If
End If
End If
以上为代码,为什么在学号列输入学号后总是显示:
调用的目标发生了异常。
从字符串“[学号] = '20144673002'”到类型“Long”的转换无效。
输入字符串的格式不正确。