Hello,
I have a database and I want to edit it's records through a DataGridView. I have done this and it works fine. The problem is that I can't see the new values until I restart my application. This is the code I am using for updating the database:
So, my problem is that I get the same value for test2 as test1. But after I restart my app the values I entered in the DGV are the correct ones.
What am I missing in order to update correctly my database and see it's new values without restarting?
Thx.
I have a database and I want to edit it's records through a DataGridView. I have done this and it works fine. The problem is that I can't see the new values until I restart my application. This is the code I am using for updating the database:
Code:
Dim test1 = (From a In DATABASE Where a.Name = "component" Select a).First 'This is just to test before and after values
MsgBox("Before: " & test1.Price)
Me.Validate()
Me.ComponentsBindingSource.EndEdit()
Me.ComponentsTableAdapter.Update(Me.ContactsDataSet.Components)
Me.ContactsDataSet.AcceptChanges()
Dim test2 = (From a In DATABASE Where a.Name = "component" Select a).First
MsgBox("After: " & test2.Pret)
What am I missing in order to update correctly my database and see it's new values without restarting?
Thx.