Vb net dataset not updating
The user can then select a table from the combobox and I then populate the datagridview on the form with the contents of the selected table.
The issue I am having is that the first time through the datagridview shows all of the contents of the selected table without a problem.
I found a work around online using the dt.columns.clear() and clear() methods to clear out the datatable instead of the dt.reset().
Background: I have an SQL database that I initially query to get a list of the tables so that I can populate a combobox.
NET Data Table (Data Table can be seen as the in memory cache of the data table in the database, I will use Data Table as the example in this post).
You will not get the true value until you commit the update to the database.
Data Source = Get Data Set For Table("Table Name"); This will set and update the new tables within the bs Object. However, I have tried your solution and replaced my datatable with a dataset and, with a minor tweaks, it seems to be working pretty well right now. Datasource = null before setting it back to the filled dataset for use with my datagridview.
If I didnt do this, the datagridview would display the correct datatable but it would still show columns from the previous table.