我的问题是我有datagridview,我选择行我点击删除按钮,但当我刷新它回来
Private Sub btnDlt_Click(sender As Object, e As EventArgs) Handles btnDlt.Click
For Each row As DataGridViewRow In dgwData.SelectedRows
dgwData.Rows.Remove(row)
SQL.DBDA.Update(SQL.DBDT)
Next
End Sub
我的upadte工作正常,它保存了所有内容,这里是代码
Private Sub btnUpdate_Click(sender As Object, e As EventArgs) Handles btnUpdate.Click
If MsgBox("Nazaj si prajete uložiť tieto zmeny?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
SQL.DBDA.Update(SQL.DBDT)
loadGrid()
btnUpdate.Enabled = False
If SQL.hasException() Then
Exit Sub
End If
Else
btnUpdate.Enabled = False
loadGrid()
End If
End Sub
答案 0 :(得分:0)
问题应该在您的数据源上,检查您的删除查询是否正常。