DataAdapter Design Question

  • Thread starter Thread starter slonocode
  • Start date Start date
S

slonocode

I see many examples of subs or functions that intialize a connection,
dataadapter, commands, parameters, etc. and then fill a datatable or
dataset table.

So my question comes from how do you handle dataadapters and scope? Do
you just recreate the dataadapter when you need to persist changes or do
you make dataadapter global scope so that it's always avaialable?

I seem to see so many examples where dataadpater is local scope to
filling a table and then i wonder how the update to database is handled.

Thanks
Slonocode
 
The best method for a Web application is to create an independant class that
contains the data adapter and data set etc. This class can be persisted using
the cache or application object between state calls.

Use the Load function to save and restore the class.
 
Back
Top