每次都在数据库上查询并使用“WHERE”运算符?
SELECT * FROM tblProduct WHERE productID = @productID
或者
过滤放入缓存的产品列表?
DataTable dtProducts = new DataTable();
dtProducts = HttpContext.Current.Cache["CachedProductList"] as DataTable;
DataView dvProduct = new DataView();
dvProduct = dtProducts.DefaultView;
dvProduct.RowFilter = String.Format("[productID] = {0}", iProductID);
请分享您的意见。提前致谢。