Re: Dataset and datatable

Tech-Archive recommends: Fix windows errors by optimizing your registry



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

.



Relevant Pages

  • Re: sorting techniques
    ... For some reason i always forget about storing the results in a session ... we bind a DataGrid with a DataTableinstance which ... > contains the data retrieved from database. ... > That' s why we set the DataTable's columns's name as their sortexpression. ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
  • Re: Please! Doesnt anyone know a better way to do this?
    ... account, they need to automatically be directed to the page to enter data ... session variable on the Account page. ... I assume here that you're checking a database when the user attempts to ... When a new user attempts to login or clicks to register, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Retrieving state information from a middle tier
    ... Now this very first call can make session root entry into an xml file like ... We have a middle tier which is made up ... > The current implementation only allows for one database to be served up. ... > longer use the middle tier as the source of the connection properties. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Horizontal scaling - advice needed
    ... the session can be unambiguously proxied to the right backend server, ... To start with have a single database machine. ... Full database clustering is challenging, but if your site is making you lots ... For transient session state, ...
    (comp.lang.ruby)
  • Re: VirtualPathProvider and Application Restart
    ... the session state to the Database Server and move a lot of lightweight ... to unload it from the AppDomain. ... When you update an ASPX file, ...
    (microsoft.public.dotnet.framework.aspnet)