Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27243

VS 2008 Update DataGridView after inserting a new row - new id of the row missing

$
0
0
Hello!

I have a DataGridView (myDataGridView.DataSource = myDataTableBindingSource) bound to a DataTable which is filled by an OleDbDataAdapter (myDataAdapter).
After the user has entered the data to a new row the row is saved to the database:
Code:

myDataAdapter.Update(myDataTable)
Now I need to update the DataGridView, because the id is assigned by the database.
In order to update the datagridview, I call this method
Code:

myDataGridView.ResetBindings()
But the id does not get updated, it stays empty. At the same time the record has been added to the database and the id has been assigned correctly.
How can I make the dataGridView to really reread all records from the database?

Viewing all articles
Browse latest Browse all 27243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>