在内存中保存一个DataView
DataSet 的Cache功能public DataView GetProducts()
 
Cache一个DataSet
DataSet中有两表,如果不用可以Cache.Remove["Products"]去除
DataSet 的Cache功能dstStore = (DataSet)Cache["Store"];
DataSet 的Cache功能    
//Cache.Remove("Products");
DataSet 的Cache功能
     
    }

在内存中找到你所要的数据
DataSet 的Cache功能DataSet dstEmployees;
DataSet 的Cache功能    SqlConnection conNorthwind;
DataSet 的Cache功能    SqlDataAdapter dadEmployees;
DataSet 的Cache功能    DataView dvwEmployees;
DataSet 的Cache功能    Object[] arrValues 
= new Object[2];
DataSet 的Cache功能    
int intEmployeeIndex;
DataSet 的Cache功能
DataSet 的Cache功能    
//Get cached DataView
DataSet 的Cache功能
      
DataSet 的Cache功能    dvwEmployees 
= (DataView)Cache["Employees"];
DataSet 的Cache功能    
if (dvwEmployees == null)
;

以下是源程序
DataSet 的Cache功能<%@ Page Language="C#" %>
DataSet 的Cache功能
<%@ Import Namespace="System.Data" %>
DataSet 的Cache功能
<%@ Import Namespace="System.Data.SqlClient" %>
DataSet 的Cache功能
DataSet 的Cache功能
<script runat=server>
DataSet 的Cache功能
void Button_Click(Object sender , EventArgs e) 

相关文章: