for the current page, define a member variablepublic dataset ds = new DataSet();if you want to persist across requests, use a session variableSession["MyDataSet"] = new DataSet();
..
DataSet ds = (DataSet)Session["MyDataSet"];you can also use Application or Cache variable if the dataset is session-independent
..
DataSet ds = (DataSet)Session["MyDataSet"];you can also use Application or Cache variable if the dataset is session-independent
2 用 viewstate存储
DataSet ds = new DataSet();
ds = (DataSet)ViewState["YourDataSet"];
cache是一个全局的、安全的线程对象,它不会消耗服务器内存。
cache ->读xml(data)介质
cache ->写xml(data)介质