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 the main requirements for caching?

545


What is rending process in ASP.NET?

621


How can you dynamically add user controls to a page?

515


Is razor a programming language?

535


What are html helpers in asp.net?

531






How does a web application session work?

558


What is ascx?

539


Where would you use an ihttpmodule, and what are the limitations if any?

533


what is command line compiler.what are the steps and how it is related to debugging.

1417


Can we set master page as a start page?

548


COM+ Used ________________ Isolation Level

1530


Explain the main function of razor in asp.net? : asp.net mvc

589


What is asp.net version?

534


Tell me what is the request flow used for asp.net mvc framework? : asp.net mvc

556


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

922