我想从datagridview中删除数据库中的多行。当我使用下面的代码时,所选行之前的所有行都将被删除,而不是仅删除选定的行。请帮忙。
Private Sub cmdDelete_Click(sender As Object, e As EventArgs) Handles cmdDelete.Click
For Each row As DataGridViewRow In dgvMasterTable.SelectedRows
SQL.DataUpdate("DELETE FROM MASTER WHERE Item_id ='" & row.DataBoundItem(0) & "' ")
next
End Sub