Re: Dataset and datatable
- From: "Aleks Kleyn" <Aleks_Kleyn@xxxxxxxxxxx>
- Date: Mon, 6 Aug 2007 22:42:18 -0400
This is asp.net application. For instance. I read large amount of data to
present in datagrid. I cannot show all data on the same page, it will take a
work to scroll down a screen. I prefered datatable because it is ready
collection, I have read data from database and connection is closed. However
when I call on datagrid next page I reload page. So I have choice. I
populate datatable one time more. Or I save it in session collection.
However I discovered, when I choose second choice and 10-15 people use this
web page, the amount of memory for aspnet.exe grows 2kb each 5-10 sec. This
continues until 100% cpu time is dedicated to memory paging. This clearly
means that I need to find better answer.
"Mark Rae [MVP]" <mark@xxxxxxxxxxxxxxxxx> wrote in message news:uKTe7WG2HHA.4880@xxxxxxxxxxxxxxxxxxxxxxx
"Aleks Kleyn" <AleksKleyn@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:92CD4405-7F1C-4DF5-B313-2AEF4C3B4901@xxxxxxxxxxxxxxxx
At this time I keep links to dataset, dataadapter and datatable in session.
Why?
Unless the data is relatively small, and needs to be fetched *once only* per session (e.g. maybe some metadata about the currently logged-on user), it is (nearly) always preferable to fetch data as and when it's needed.
As a general rule, the more "room" you can give your ASP.NET app, the better it will perform. ADO.NET uses something called connection pooling which means that many small database reads will always perform much better then a few large database reads.
Overuse of session is one sure way of cripping your ASP.NET app - how much data are you actually storing in session...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
.
- Follow-Ups:
- Re: Dataset and datatable
- From: Mark Rae [MVP]
- Re: Dataset and datatable
- References:
- Re: Dataset and datatable
- From: Mark Rae [MVP]
- Re: Dataset and datatable
- Prev by Date: Re: reference and value
- Next by Date: RE: web.config section replacement
- Previous by thread: Re: Dataset and datatable
- Next by thread: Re: Dataset and datatable
- Index(es):
Relevant Pages
|