Click here to Skip to main content
15,898,371 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,
How to store a datagridview in cache and how to retrieve that datagridview and asign?

C#
public void StoreGridInCache(String CacheKey, DataGridView _dataGrid)
        {
            //DataTable dtInCache = new DataTable();

            HttpRuntime.Cache.Add(CacheKey, _dataGrid, null, DateTime.Now.AddHours(1), TimeSpan.Zero, CacheItemPriority.High, null);

            return;
        }


this.dataGridViewPopupDetails.DataSource = (DataGridView)HttpRuntime.Cache.Get(CacheKey);


In this code the datagridview not displaying...how to rectify this?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900