Solved

What is the optimal amount of data for DataSet.

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How useful is the free version of Selenium? 3 35
Google Directions API to Map URL -C#? 3 26
PrintingFoundIt(Almost!(Damn!)) 1 27
C# Gridview 1 32
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 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