Cache ASP.Net Tutorial

<%@ Page Language="C#" Trace="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Web.Configuration" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    void Page_Load()
    {
        DataSet products = (DataSet)Cache["Products"];
        if (products == null)
        {
            products = GetProductsFromDB();
            Cache.Insert("Products", products, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(5));
        }
        grdProducts.DataSource = products;
        grdProducts.DataBind();
    }
    private DataSet GetProductsFromDB()
    {
        Trace.Warn("Getting products from database");
        string conString = WebConfigurationManager.ConnectionStrings ["Products"].ConnectionString;
        SqlDataAdapter dad = new SqlDataAdapter("SELECT Title,Director FROM Products", conString);
        DataSet products = new DataSet();
        dad.Fill(products);
        return products;
    }



    Show Sliding Expiration


    
    

            id="grdProducts"
        Runat="server" />