Code: Saving a Dataset to View State (Visual C#)
sqlDataAdapter1.Fill(dSet);
System.IO.StringWriter sw = new System.IO.StringWriter();
// Write the DataSet to the ViewState property.
dSet.WriteXml(sw);
ViewState["dSet"] = sw.ToString();
Code: Retrieving a Dataset from View State (Visual C#)
if (Page.IsPostBack)
{
System.IO.StringReader sr =
new System.IO.StringReader((string)(ViewState["dSet"]));
dSet.ReadXml(sr);
}