Click here to Skip to main content
15,896,730 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So I've used a binding navigator and when I press the delete item, the row is deleted, but when I leave the program and go in it again, the deleted row is still there in the data grid view.

What I have tried:

For the delete item:
VB
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorDeleteItem.Click
        DataBindingSource.RemoveCurrent()
    'I've also tried including the code below

    TableAdapterManager.UpdateAll(UserDataDataSet)

End Sub

For the save item:
VB
Private Sub bnMonitorHeartRateSaveItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorSaveItem.Click

Try
    DataBindingSource.EndEdit()
    DataTableAdapter.Update(UserDataDataSet.Data)
    MessageBox.Show("Data Saved")
Catch ex As Exception
    MessageBox.Show("error occurred while saving data")
End Try
Posted
Updated 29-Aug-20 4:37am
v3
Comments
Richard MacCutchan 29-Aug-20 7:54am    
You need to update the database to remove the deleted row(s). You can do it manually or direct through the binding control.
[no name] 29-Aug-20 12:18pm    
Sometimes its project settings: the "data" get restored when you rebuild because of something you put (or didn't) in the "build action".
Sandeep Mewara 30-Aug-20 2:11am    
Is there a another instance of your access MDB in the debug folder?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900