hi there
i want to delete selected rows from datagridview and table,
when i select multiple rows from datagridview and press delete then it delete only
one row.
ex.
1 John
2 Raju
3 Vikey
4 Lisha
5 Michel
if i select 1st and 3rd record then i want delete both from database.
here my code.
con.Open()
For i = 1 To DataGridView1.Rows.Count - 2
ss = "Delete from Grading where ID=" & DataGridView1.SelectedRows(i).Cells(0).Value & ""
com = New OleDbCommand(ss, con)
com.ExecuteNonQuery()
Next
con.Close()
MsgBox("Data Deleted Successfully !")