Reloading DataSet

  • Thread starter Thread starter David Lei
  • Start date Start date
D

David Lei

Hi,

What's the best way to reload a DataSet?

I have a DataSet object with multiple tables in it, I would like to
refresh a table(reloading the data from sql server)
in this dataset when a user click a refresh button.

Thanks for your help.

david
 
This question was asked a few days back on this news group.

For the changed/updated/added rows, you can do dataset.merge.
For deleted rows, you have no option but to loop through manually and check
and see which rows got removed. Or you can delay this operation until the
data is saved, and then throw an error during the dataadapter.update

If the dataset is small enough, it is almost easier to rebuild it everytime.
Else you have to use the above approach.

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
 
Back
Top