How to convert a datareader to datatable?

  • Thread starter Thread starter abc my vclass
  • Start date Start date
ABC,

In the same way as that you convert an engine to a wheel of a car.

A datareader is a class that is used by the dataadapter to load a datatable.

I hope this gives an idea.

Cor
 
Teemu,

Why do you think that as written on the blog page that it is a fast
solution. We have almost as long as our website exist this sample on our
website, however I will never tell that it is fast. It is slow, but can be
used if someone wants a progressbar. And than he/she should have a huge
amount of data and accept that it is going a little bit slower.

http://www.vb-tips.com/default.aspx?ID=49f2cff5-56ad-44fc-a4c6-fc0d5c470f53

Just my thougth,

Cor
 
Cor,
Why do you think that as written on the blog page that it is a fast
solution. We have almost as long as our website exist this sample on our
website, however I will never tell that it is fast.

Did I say something like that? Which one of those few implementations I've
said is fast? There are quite many variations on that blog, if you check
them (comments also) Not sure if I follow your question, though.
It is slow, but can be used if someone wants a progressbar. And than
he/she should have a huge amount of data and accept that it is going a
little bit slower.

http://www.vb-tips.com/default.aspx?ID=49f2cff5-56ad-44fc-a4c6-fc0d5c470f53

Ah, If you mean which one I'd use, I'd take the one inheriting from
DBDataAdapter or the one using BeginLoadData and LoadDataRow (DBDataAdapter
uses that internally, so the selection goes to scenario preference). Why?
Because using BeginLoadData turns off constraints , index maintaining etc
when loading data.

Regards,

Teemu
 
Teemu,

Ah, If you mean which one I'd use, I'd take the one inheriting from
DBDataAdapter or the one using BeginLoadData and LoadDataRow
(DBDataAdapter uses that internally, so the selection goes to scenario
preference). Why? Because using BeginLoadData turns off constraints ,
index maintaining etc when loading data.

I like just the DBDataadapter.

The slight performance that is gained by other solutions, is in my opinion
lost by wors maintainability.

Cor
 
Like Miha mentions, Datatable.Load works great ifyou're using the 2.0
Framework, but out of curiousity, what is the challenge your wanting to
address by doing this?
 
Back
Top