Can you store dataset in viewstate?

Answer Posted / rajamurugesh

//Create new dataset :
DataSet ds = new DataSet();
//Store the dataset directly into view state
ViewState["dsn"]=ds;
//retrieve the dataset where it required
GridView1.DataSource = (DataSet)ViewState["dsn"];

Is This Answer Correct ?    44 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are web server controls in asp.net?

548


Will the asp.net validators run in server side or client side? How do you do client-side validation in .net?

519


What is paging in context of Memory?

647


Explain http handlers? Where we can use the http handlers?

681


Explain the difference between dataset and datareader.

527






Am not able to move the controls on the form freely in asp.net 3.5 even though I selected the position as relative or absolute for those controls. What should I do to overcome this?

1942


Differentiate between early binding and late binding.

571


How could you modify xaml content from javascript?

505


By default, Web API sends HTTP response with which of the following status code for all uncaught exception?

967


Explain the use of resource manager class in .net.

501


What is boxing and unboxing in asp.net?

665


What is the difference between a default skin and a named skin?

583


What are the different kinds of assemblies?

520


Define authentication and authorization.

617


Where sessions are stored?

650