How to store a dataset in a viewstate?

Answer Posted / pradhan prasanta kumar

Hi..
store a dataset in a view state is not Recommend.
//da(sqldataadapter);dataset dSet
da.Fill(dSet);
System.IO.StringWriter sw = new System.IO.StringWriter();

// Write the DataSet to the ViewState property.
dSet.WriteXml(sw);
ViewState["dSet"] = sw.ToString();

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you implement sql caching in asp.net?

555


Can viewstate be accessed in another page?

498


How would you enable impersonation in the web.config file?

532


List down the sequence of methods called during the page load.

516


Why asp.net is used?

549






Can we handle the error and redirect to some pages using web.config?

893


What are server objects?

505


How many types of file extensions for razor views in ASP.Net MVC?

565


How do I send an email message from my ASP.NET page?

516


When Cookies are expired in ASP.NET?

563


Why is global asax is used for?

506


How do you use viewstate?

544


In a Repeater control how one can provide an alternating color scheme ?

550


What is the use of asp.net web api?

569


Any one can tell how we store tiff format images in database and retrive from the database(need for tiff format only)

1603