Private Sub btnremove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnremove.Click
If MessageBox.Show("Do you really want to remove this task?", _
"Remove", MessageBoxButtons.YesNo, _
MessageBoxIcon.Warning) = DialogResult.No Then
MsgBox("Operation Cancelled")
Else
Dim cb As New OleDb.OleDbCommandBuilder(da)
con.Open()
ds.Tables("todolist").Rows(inc).Delete()
MaxRows = MaxRows - 1
ds.AcceptChanges()
con.Close()
inc = 0
NavigateRecords()
da.Update(ds, "todolist")
End If
End Sub
NOTE : the msgbox's default button is NO
if you press NO
it wont delete the Entry when msgbox prompt press YES
then the code will pass into delete section then only it will remove from DB
try this if not works come back