Can you store dataset in viewstate?

Answer Posted / lalit pradhan

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

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

549


Why would anyone need to implement their own hashtable or linked list?

2438


Is asp.net and .net are same or different?

528


What are themes and skins in 2.0, explain usage scenario?

526


Explain the flow of processing of the request? : asp.net mvc

537






Define the term Scavenging in Caching?

580


What is the basic purpose of the required field validator? How can you use a required field validator to check that the user changes the initial value of a text box? a listbox?

1427


What are the page life cycle events?

498


What are the properties of the eventargs argument when capturing keyboard events?

546


What is difference between View State and Hidden Field in ASP.NET?

661


What is form method?

499


Can a master page have more than one contentplaceholder?

510


benefits of migration from asp to asp.net hi frnds, i have to give presentation to a client about how useful would be migrating their project from asp to asp.net .plz give me some points which i should incorporate in my ppt thanks

1674


Where is http session stored?

503


Is viewstate secure?

514