Solved

What is the optimal amount of data for DataSet.

Posted on 2004-09-11
4
191 Views
Last Modified: 2010-04-15
Hi
 I have a question, I’m doing some database application and I have to retrieve significant amount of rows from database in one time let say 2000 rows. Would it kill performance of my application?  I mean computer memory for instance.

How many rows can I store in DataSet without making user life miserable.

Anyone has an idea how efficient is dataSet in C#.


Thanks.
0
Comment
Question by:knobloch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 15

Expert Comment

by:Timbo87
ID: 12035510
If you need to edit the data, a DataSet or DataTable is definitely the way to go. If you're only reading the data or databinding, use a DataReader, which is more efficient but not directly editable.

Here's an articles on the pros and cons of a DataSet vs. DataReader:
http://msdn.microsoft.com/msdnmag/issues/04/06/DataPoints/default.aspx
0
 
LVL 19

Accepted Solution

by:
Desp earned 350 total points
ID: 12037639
Just an addition to what timbo has said that you can also use dataset for reading when the number of records are small , for large number of rows DataReader always gives best performance ..  DataReader are more faster than datasets.. the only drawback i found using datareader is that they dont have any property which return the number of records.  on the other hand you can also use the datareader + Stored procedures to update/delete from the DB
0
 
LVL 19

Expert Comment

by:Desp
ID: 12037756
here are some differnces
Dataset
-Need to disconnect/distribute data
-Need support for modifying/updating data
-Need data schema support

Datareader
-Fast read-only access
-When you want to use the data for something other than a dataset

Source:
http://donxml.com/allthingstechie/archive/2004/06/25/862.aspx
Info:
DataSet - 411 ( 18.6% slower than the DataReader)
0
 
LVL 10

Assisted Solution

by:ptmcomp
ptmcomp earned 150 total points
ID: 12039750
If you have large amount of data you have two possibilities:
- load only small amounts of data in a DataSet (untyped datasets are a bit faster)
- don't use DataSets
The DataSets are not made for large amount of data. To point you in the right direction we should know a bit more of the application you are going to build. I prefer using my own data objects when using them in business logic. Custom serialization can speed up serialization and deserialization.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

696 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