请教:删除员工信息 ,同时对应表中的员工也删除,但是出现问题? 如果删除第一条 则其他表对应员工删除不了,数据还在,从中间删除能删除?为啥,请教!代码如下If Tables("人员信息").Current Is Nothing Then
Return
End If
Dim Result As DialogResult
Result = MessageBox.Show("确定删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
Dim gh As String
gh=Tables("人员信息").current("员工号")
Dim pr1 As DataRow
Tables("人员信息").Current.Delete
Tables("人员信息").save()
pr1 = DataTables("全部").Find("员工号 = '" & gh & "'")
If pr1 IsNot Nothing Then
Tables("全部").current.delete()
End If
Dim pr2 As DataRow
pr2 = DataTables("工资信息").Find("员工号 = '" & gh & "'")
If pr2 IsNot Nothing Then
Tables("工资信息").current.delete()
End If
Dim pr3 As DataRow
pr3 = DataTables("绩效奖金").Find("员工号 = '" & gh & "'")
If pr3 IsNot Nothing Then
Tables("绩效奖金").current.delete()
End If
Dim pr4 As DataRow
pr4 = DataTables("其他补贴奖项").Find("员工号 = '" & gh & "'")
If pr4 IsNot Nothing Then
Tables("其他补贴奖项").current.delete()
End If
End If