Dim xh As String
Dim tbl As Table = Tables("课程表")
If tbl.Current IsNot Nothing Then
xh= tbl.Current("序号")
End If
messagebox.show(xh)
Dim dr As DataRow
dr = DataTables("学习记录").Find("序号 = '" & xh & "'")
If dr IsNot Nothing Then '如果找到的话
MessageBox.Show("此班级还有学生,不能删除!")
Else
MessageBox.Show("此班级没有学生,可以删除!")
End If