Solved

What is the optimal amount of data for DataSet.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Data Saving(2) 2 41
New to SOAP and need some direction 10 47
Need help on C# Linq query on object 6 53
Name space syntax error 12 44
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

23 Experts available now in Live!

Get 1:1 Help Now