in Education by
What is Data Cache in ASP.NET and how to use?

1 Answer

0 votes
by

Data Cache is used to store frequently used data in the Cache memory. It's much more efficient to retrieve data from the data cache instead of database or other sources. We need to use System.Web.Caching namespace. The scope of the data caching is within the application domain unlike "session". Every user is able to access this object.

When client requests to the server, server executes the stored procedure or function or select statements on the Sql Server database then it returns the response to the browser. If we run again same process will happen on the web server with sql server.

How to create data cache?

Cache ["Employee"] = "DataSet Name"

We can create data caching use Cache Keyword. It's located in the System.Web.Caching namespace. It's just like assigning value to the variable.

How to remove a Data Cache?

We can remove Data Cache manually.

  1. //We need to specify the cache name  
  2. Cache.Remove(String key);  

Related questions

0 votes
0 votes
    How to use repeater control in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    What are the data controls available in ASP.NET?...
asked Apr 6, 2021 in Education by JackTerrance
0 votes
    How can we improve the Performance of an ASP.NET Web Page?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
    How can we apply themes in ASP.NET application?...
asked Apr 6, 2021 in Education by JackTerrance
0 votes
    What are the differences between ASP.NET HttpHandler and HttpModule?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    What is the difference between HttpContext.Current.Items and HttpContext.Current.Session in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    What is authentication and authorization in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    What is Enterprise Library in ASP.NET?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
    What is WebParts in ASP.NET?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
    What are the Navigations techniques in ASP.NET?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
0 votes
    Explain Cookie-less Session in ASP.NET?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
    What is the PostBack property in ASP.NET?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
    Explain GridView control in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
...