asp.netsessionviewstatestate-management

Storing DataSet in ViewState or Session State


Currently I am storing the DataSet in a ViewState but, this may have an impact on the performance of the page.

Can you suggest me whether I can use Session or ViewState or any alternative by which it doesn't impact the performance?


Solution

  • Why do you need to store the whole dataset? If you have to, then do it in session. If your session is "inproc" the dataset object will be stored in memory (you save some performance because there will be no serialization).

    If I was you, I would analyze the code and try not to store the whole dataset in neither session, not viewstate - there must be a way to optimize your code.