Re: TableAdapter vs DataAdapter by s
s
Fri Sep 29 12:21:25 CDT 2006
Hi Cor,
thanks for sharing. I read all this in the ADO.NET 2.0 Core ref. I can
imagine using both, but I my opinion filling a whole dataset which
include multiple tables and relations can best be done using a DA. For
filling particulair tables, i.e. when you don't need a complete
dataset, TA is best to use.
I think I'll stick to that.
Further comments are welcom, always eager to learn.
Cor Ligthert [MVP] schreef:
> Hi,
>
> The DataAdapter is the abstract/mustinherit class from all DataAdapters. In
> that are the SQLDataAdapter and the OleDBdataadapter.
>
> The table adapters are strongly typed derived classes from those, they are
> used with strongly typed datasets and have extra methods in them.
>
> Telling when to use is hard to do, most regulars in this newsgroup avoid the
> TableAdapters because that puts them in a cuirass, I see more newbies using
> the TableAdapters.
>
> No answer, but just a try to explain it.
>
> Cor
>
> <s.bussing@symax.nl> schreef in bericht
> news:1159544748.922967.182840@i42g2000cwa.googlegroups.com...
> > Hi,
> >
> > I was wondering when to use TableAdapters (TA) and when to use
> > DataAdapters (DA).
> >
> >
> > If I've got a typed dataset containing multiple related tables, I would
> > say use a DA to fill the dataset. Why should I use TA instead? I can
> > imagine situations where may be just one table from the dataset is
> > needed, in that case you might say, use a TA. I agree on that.
> >
> >
> > What about updating a typed dataset containing multiple related tables.
> > In that case I also would use a DA rather than TA's. I presume I will
> > need multiple TA's when updating multiple tables in this typed dataset
> > (i.e. added orderd and orderdetails in the typed dataset).
> >
> > Conclusion: If I want to use just a few tables I would better fill the
> > tables using TA's and if I've got just one table to update I could also
> > use a TA. But when filling a dataset in one operation and when updating
> > multiple tables in a dataset I would better use a DA.
> >
> > Is this correct?
> >
> > P.S.: I will not use SQL in code, just SPROC's
> >