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

9. Why should we hire you over the others waiting to be interviewed?

2257


What is web router?

590


What is semantic gap?

723


What is windows active directory authentication?

652


What is the best Macanism to clear the Cache in asp.net

816






Give a few examples of page life cycle events.

766


What is data cache in sql server?

687


How can you apply a theme to your asp.net application?

619


Explain file-based dependency and key-based dependency.

653


What are asp.net web forms?

633


What asp.net control can embed xaml into asp.net pages?

628


What are the advantages of asp.net?

629


Explain the difference between server control and html control.

581


How can we secure the data which is send from client side to server? Like the login id and paasword needs to be authenticated on the server but we cannot send it in plain text into the server.One more thing we are not using the SSL here.

1536


How many web.config files can I have in an application?

630