Reusing data controls

  • Thread starter Thread starter Vik
  • Start date Start date
V

Vik

I use the same dataadapters and datasets on a few aspx pages. Currently I
create these data controls on each page. Is it possible to create these
controls only once and then use them on the different pages?

Thanks.
 
Everything is torn down and rebuilt with each new page, so the only way to
"create once" is to persist them across the pages--i.e. use session
variables. For a dataadapter, that's likely not worth the trouble, but for a
dataset it might be (depending on how large it is, how intense the i/o,
whether you want to keep it at the application level, etc.).
 
I meant reusing the data controls in design time, not in run time. That is
creating the data controls in one place and referring to them in other
pages. Now if I redesign a table in a database I have to recreate the
dataadapters and datasets in all the pages that use that table. I'm looking
for a way to make these changes only once in one place.

Vik
 
Sorry, I'm not much help there. I always roll my own dataadapters at
run-time, and I don't strongly type the data.
 
Back
Top