How to store a dataset in a viewstate?

Answer Posted / kinjal panchal

when you add dataset into dataAdupter like

dataset ds=new dataset();
dataAdupter da=new dataAdupter();
da.fill(ds);

then create one stringwriter
system.io.strinwriter sw=new system.io.stringwriter();

your dataset write into this stringwriter
ds.writeXML(sw);
viewstate["ds"]=sw.tostring();

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are custom controls?

520


What is the difference between a page theme and a global theme?

518


What is difference between session and cookie?

503


Explain how does asp page work?

561


What is data control in asp.net?

504






What is a SESSION and APPLICATION object?

566


What is protected configuration?

592


How you can manage the state of application at the server side in ASP.NET?

560


How will you load dynamic assembly?

526


If you are using two select queries and retrieving data. how do you access second query's result set using data reader?

4731


What is the difference between Session and response.Redirect?

600


Do you know caching feature?

553


How do I debug an asp.net application that was not written with visual studio.net and that does not use code-behind?

535


Why does my asp.net file have multiple tag with runat=server?

562


What is active web pages?

494