Can you store dataset in viewstate?
Answers were Sorted based on User's Feedback
Answer / rajamurugesh
//Create new dataset :
DataSet ds = new DataSet();
//Store the dataset directly into view state
ViewState["dsn"]=ds;
//retrieve the dataset where it required
GridView1.DataSource = (DataSet)ViewState["dsn"];
| Is This Answer Correct ? | 44 Yes | 7 No |
Answer / shashikesh mishra
yes.We can store dataset in view state.Not a dataset any
serialible object type(datatable,dataset etc..) to be store
in view state.
| Is This Answer Correct ? | 23 Yes | 5 No |
Answer / 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 |
Answer / masthan
yes,you can store dataset into viewstate directly.
dataset ds=new dataset();
viewstate["newds"]=ds;
datagrid1.dataspurce=(dataset)viewstatw["newds"];
datagrid.databind();
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / chinmoy
Yes, you can store any serializable data in viewstate.
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / venkat
//create datatable
datatable dt = new datatable();
//Create new dataset :
DataSet ds = new DataSet();
ds.table.add(dt);
//Store the dataset directly into view state
ViewState["dsn"]=ds.table[0];
//retrieve the dataset where it required
DataSet ds = (DataSet)ViewState["dsn"];
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
| Is This Answer Correct ? | 1 Yes | 3 No |
Answer / mansing patil
No, You cant directly store Dataset in ViewState. You can
get XML from dataset store that Xml in ViewState. While
getting From ViewState convert to xml and then from xml to
dataset
| Is This Answer Correct ? | 9 Yes | 22 No |
Can One website be made using two different languages like c#,vb.net etc......
What is a web server? What are the load limits in it?
How To Call Outside Javascript File? Example : Our Project File Folder Name "Sample" Another Folder Name "Check".Check Folder Is Out Side Of Our Project ?Check Folder Have Verify.Js File. My Question Is How To Call Verify.Js File.
3 Answers Consagous, Phoenix Technologies,
What is WCF
what is <location> tag?
What does assemblyinfo.cs file consist of?
How you will handle session when deploying application in more than a server?
What is web api and why to use it?
Where is the view state data stored in asp net?
Explain the asp.net session state modes.
Explain in what order a destructors is called.
What is asp.net mvc? : asp.net mvc
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)