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

In What Order Do The Events Of An Aspx Page Execute. As A Developer Is It Important To Undertsand These Events?

677


What is & in a url?

625


Explain authorization levels in .net ?

690


What is http session state?

597


what is DLL Hell and how it is solved in .NET? please explain clearly??

1970






Define transparent caching with aop?

622


What is the difference between web config and machine config files?

648


Explain client-side scripting?

656


How to implement Authentication and Authorization?

652


Explain asp.net mvc request life cycle? : asp.net mvc

571


Explain about ASP.NET?

723


What is difference between session and cookies in asp net?

587


Do you know caching feature?

656


what is the difference between response.write() and response.output.write()?

802


How long the items in ViewState exists?

1057