-
Refreshing a DataSet
Searched for this, but could not find.
I have a windows form with data bound controls. Typical first, next, last etc buttons to move through the records. User can create a record and update the DB, via dataadapter.update.
Wondering what is the preferred method of updating the client's view? For example, I'm displaying an identity colum and need the database-created value.
Just fill the dataset again with the same table name after re-populating the dataadapter? Somehow truncate the table in the dataset first? Any thoughts appreciated.
Mike
-
You can probably just fill the dataset again then bind it again to the controls.
-
Not sure if this is the best method, but it seems to work. If you call the dataadapter.fill on a table that's already in the dataset, the information appends to the dataset's table, so it looks like you have to clear it first.
So I cleared it, got the data again, filled the dataset, then moved to the row I just created.