Solved

What is the optimal amount of data for DataSet.

Posted on 2004-09-11
4
187 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
  • 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now