Using DataAdapter Update method from a component

  • Thread starter Thread starter STom
  • Start date Start date
S

STom

I have seen examples where you can fill a data adapter, make modifications
to the dataset and then do an update on the data adapter.

But, if I have a component that uses a data adapter to get the dataset and
pass it back to me, then later I want to do an update and call maybe a
different function to do the update, do I need a reference to the exact same
data adapter?

What are some ways that others have done this?

Thanks.

STom
 
You don't need to use the same data adapter. Any data adapter that has been
properly configured to persist the dataset changes in the way you wish can
be used.

HTH,
Nicole
 
I assume this is because the dataset itself keeps track of row changes?

If I use 5 data adapters to fill in 5 tables in the dataset, I assume that I
need to create the same configuration of data adapters and call Update on
each of them?

And thanks for the quick answer!

STom
 
No. One DataAdapter will work. You can call Update on the same DataAdapter
5x, passing in each Datatable.

The call to Update looks at each DataRow in the Datatable. If Added or
Modified, it calls the appropriate Command.
 
Back
Top