Asp.net Caching Issue
<p>I have cached a  dataset which has "StoreId" column.
When I want to export the dataset to Excel I suppose to remove the "StoreId" column from the dataset and Exprot.</p>

<p>Following is the code for Removing and Exporting to Excel.</p>

<pre><code>if (HttpContext.Current.Cache["stores"] != null)
        {
            using (DataSet dsStores = (DataSet)HttpContext.Current.Cache["stores"])
            {
                if (TrainingUtil.isDataSetValid(dsStores))
                {
                    DataTable dt = dsStores.Tables[0];
                    dt.Columns.Remove("storeId");
                    Quality.Qulaity_Utility.ExportDataSet(dt, ddlCity.SelectedItem.Text.ToString() + "_StoreCodes");
                }

            }
        }

  public static void ExportDataSet(DataTable dt,string filename)
    {
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.Buffer = true;
        HttpContext.Current.Response.ContentType = "application/vnd.xls";
        HttpContext.Current.Response.Charset = "";
        HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=" + filename.Replace(" ", "_").ToString() + ".xls");

        DataGrid dgRecord = new DataGrid();
        //Color Setttings
        dgRecord.HeaderStyle.BackColor = System.Drawing.Color.Cyan;

        dgRecord.DataSource = dt;
        dgRecord.DataBind();

        //Cells color settings
        foreach (DataGridItem dgi in dgRecord.Items)
        {
            foreach (TableCell tcGridCells in dgi.Cells)
            {
                tcGridCells.Attributes.Add("class", "sborder");
            }
        }
        //Render the datagrid

        StringWriter stringWriter = new StringWriter();
        HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);
        dgRecord.RenderControl(htmlTextWriter);
        //lstMonthlyReport.RenderControl(htmlTextWriter);
        //Add the style sheet class here
        HttpContext.Current.Response.Write(@"&lt;style&gt; .sborder { color : Black;border : 1px Solid Black; } &lt;/style&gt; ");
        //Export
        HttpContext.Current.Response.Write(stringWriter.ToString());
        //End
        HttpContext.Current.Response.End();
        //style to format numbers to string
        //string style = @"&lt;style&gt; body { mso-number-format:\@; } &lt;/style&gt;";
    }
}
</code></pre>

<p>after exporting the data and When I once againg want Stores information from Cached dataset
I was unable to find the "StoreId" Column,
I'm unable figure out where I'm doing wrong.
Plz help me out. </p>

<p>Thanks in advance.</p>
