PC Review


Reply
Thread Tools Rate Thread

How to convert a datareader to datatable?

 
 
abc my vclass
Guest
Posts: n/a
 
      18th Dec 2005
How to convert a datareader to datatable?


 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      18th Dec 2005
DataTable.Load?

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"abc my vclass" <(E-Mail Removed)> wrote in message
news:eu$(E-Mail Removed)...
> How to convert a datareader to datatable?
>



 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      18th Dec 2005
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


 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      18th Dec 2005
Check this blog post:

Convert a DataReader into a DataSet
http://weblogs.asp.net/rosherove/arc.../22/61541.aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU

http://blogs.aspadvice.com/joteke
"abc my vclass" <(E-Mail Removed)> wrote in message
news:eu$(E-Mail Removed)...
> How to convert a datareader to datatable?
>



 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      18th Dec 2005
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?...6-fc0d5c470f53

Just my thougth,

Cor


 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      18th Dec 2005
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?...6-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


 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      19th Dec 2005
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


 
Reply With Quote
 
W.G. Ryan - MVP
Guest
Posts: n/a
 
      19th Dec 2005
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?
"abc my vclass" <(E-Mail Removed)> wrote in message
news:eu$(E-Mail Removed)...
> How to convert a datareader to datatable?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datareader to Datatable gets stuck... =?Utf-8?B?am9uZWZlcg==?= Microsoft ADO .NET 3 29th May 2007 06:19 AM
Using a DataTable instead of a DataReader =?Utf-8?B?am9uZWZlcg==?= Microsoft ADO .NET 7 26th Sep 2006 05:08 AM
Filling a DataTable with a DataReader =?Utf-8?B?SlQ=?= Microsoft ADO .NET 0 10th Oct 2005 06:40 AM
DataReader to DataTable... =?Utf-8?B?VGltOjouLg==?= Microsoft ASP .NET 3 18th Jul 2005 02:46 PM
Convert DataReader into DataTable Vinod I Microsoft ADO .NET 2 2nd Jan 2004 03:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:43 AM.