Solved

loading SqlDataReader into a DataTable object

Posted on 2007-04-07
3
366 Views
Last Modified: 2012-05-05
I am writing a commerical website in asp.net I know that the SqlDataReader is the fastest way to read data from the database, but the bad thing about it is that it requires an open connection to operate. I read in a book that I can load all the data returned by the SqlDataReader into a DataTable object, which is capable of storeing the data offline without needing an open connection, then use that DataTable object to bind it to my UI controls. Does that sounds like a good design?
0
Comment
Question by:pharosinnyc
3 Comments
 
LVL 14

Expert Comment

by:steveberzins
ID: 18870892
long story short, not enough information in your question to say it is good or bad. :)

With little information to go on, it is probably the safest for most situations to pass stuff around in DataSets/DataTables and not keep connections open longer than absolutely necessary.
0
 
LVL 5

Accepted Solution

by:
asp_lha earned 500 total points
ID: 18871615
You can use DataReader or DataSet to get data, it's up to your architecture

here is a article discuss about this:
Contrasting the ADO.NET DataReader and DataSet
http://msdn.microsoft.com/msdnmag/issues/04/06/DataPoints/

0
 

Author Comment

by:pharosinnyc
ID: 18873044
for my architecture, I will have a data store, data access layer, business layer and UI. I might merge the data access layer with the business layer though..
It looks like my question doesn't have a specific answer. Each technique has its pros and cons.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question