ADO.NET dataset limit

  • Thread starter Thread starter RdS
  • Start date Start date
R

RdS

hello,

When I create a form that ties to dataset of table with only 20 records in
it I understand that all 20 records are copied to my local computers memory
for manipulation. Then if rows were modified the tableadapter class updates
table in DB. However, I am curious to know what occurs if a table has
thousands or 100's of thousands of rows in it. Does ado.net copy all of the
rows to my local computers memory if I don't specify a condition for what
records I want returned?

For instance if my form will allow user to browse all customer records.
Won't we start to have memory issues and slow initial performance while all
records are copied to local storage? How does ADO handle large datasets?

How should I handle such a case?

Thanks in advance.
 
Hi RdS,

Yes, as you understand, when you use a DataAdapter to fill the DataSet, it
puts all the records that SELECT statement returns into the DataSet. If the
SELECT statement returns 100's thousand rows, they will all be filled to
the DataSet. Whether this operation will succeed depends on how big your
memory is.

However, in my opinion, if you have a 100's thousand database table, it is
not a good idea to fill everything into the DataSet. Here are the reasons:

1. As you know, memory will be used up, and apps are slowed down.
2. A user cannot see every record since he's not a super man. :-)

In this case, if a user need certain record(s) from the database, use WHERE
clause in SELECT statement. It will return only the rows needed which saves
memory.

In certain cases, a user need to browse all the records, you can use paging
to decrease the amount of data each time that comes to local memory.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
I understood why you wouldn't do and understand how to write SQL statements.
I was just curious if VB would allow such a thing or if it cared. Also, if
someone attempted to fill a dataset with 100's of thousands of records and
the memory couldn't hold it what errors would be encountered?

Thanks,
 
Back
Top