GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Microsoft  >  ASP.NET 2.0
Go To First  |  Previous Question  |  Next Question 
 ASP.NET 2.0  |  Question 140 of 159    Print  
Data Caching
How Data Caching achieved in Asp.net 2.0


  
Total Answers and Comments: 1 Last Update: May 20, 2008     Asked by: InterviewForum 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 20, 2008 07:09:29   #1  
monika_iims Member Since: March 2008   Contribution: 1    

RE: Data Caching

Using Data Caching
The .NET data caching API is comprised of the two classes in the System.Web.Caching namespace. The first class, Cache, is the class we'll be using to add and remove items from the data cache. The second class, CacheDependency, is used when assigning a cache dependency to an item in the data cache (we'll be discussing this in due time).

To add an item to the cache you can simply do:

' In VB.NET Cache("key") = value  // In C# Cache["key"] = value; 

Note that the C# version uses brackets instead of parenthesis when referencing the items of the cache in the above manner. In the remainder of the examples in this article I will be using VB.NET syntax, but will point out any major differences between the VB.NET and C# syntax.

The above code adds the item value to the data cache with the key key. The key is used to reference the item at some later point. That is, in another ASP.NET Web page we can extract the value inserted above by using:

value = Cache("key")        - or -  value = Cache.Get("key") 

To explicitly remove an item from the data cache you can use the Remove method, specifying the key of the cache item you want removed:

Cache.Remove("key")


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : There is no direct sorting provided by dataset or datatable. Sorting and filtering facility is provided by dataview. You can sort the data using DataView. DataSet ds = new DataSet(); // assume that dataset has datatable name mytable. DataTable ...

Latest Answer : Dataadapter1.Fill(ds) where ds is the dataset object name and fill() method is used to fill the dataset from the dataadapter ...

Latest Answer : Yep, Sure. In ItemdataBound event, you can play data as you wish. ...

Latest Answer : itemtemplate ...

What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?

Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?

Latest Answer : Dataset. Data is serialized and deserialized when transferred from client to server and back in Web Services.Dataset can be serialized and therefore correct option. ...

Latest Answer : By default server side validation occures when using the validation controls.Additionally client side validation can be done through javascript.This increases the execution speed since it doesn't occur in the server.But when checking between of two ...
Read Answers (4) | Asked by : Calvin

Latest Answer : RangeValidatorRegular Expression validatorRequied Form ValidatorCustom ValidatorCompare Validator ...
Read Answers (5) | Asked by : Calvin

Latest Answer : The messages are typically transported using the HTTP protocol, which is the protocol used to request/receive web pages from a web server to a browser. Web service can use other transport protocols however, such as SMTP, but HTTP is used in the vast majority ...
Read Answers (3) | Asked by : Ashish Yadav


 Sponsored Links

 
Related Articles

Breaking up XML into Relational Data

Breaking up XML into Relational Data While the preceding example shows how to construct an XML representation over relational data the example in this section illustrates how you can shred XML data back into relational data This reverse operation can be useful if your application works with relation
 

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Retrieving XML Data

Retrieving XML DataTo retrieve XML data from an XMLType table you can use a SELECT SQL statement just as you would if you had to query a relational table For example to select the employee with the id set to 100 from the employees XMLType table discussed in the preceding section you might issue the
 

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

ODP.NET - Techniques to Improve Performance while Retrieving Data

ODP NET Techniques to Improve Performance while Retrieving Data Performance tuning is a great subject in Oracle Volumes of books would not be enough to cover every aspect of performance tuning in Oracle However in this section we will only discuss the fundamental performance techniques while working
 

ODP.NET - Populating a Dataset with a Single Data Table

ODP NET Populating a Dataset with a Single Data Table A dataset is simply a group of data tables These data tables can be identified with their own unique names within a dataset You can also add relations between data tables available in a dataset mosgoogle The following code gives you the details o
 

ODP.NET - Retrieving Typed Data

ODP NET Retrieving Typed Data While retrieving values from OracleDataReader we can extract information available in individual columns of a particular row either by using column ordinal position values or column names mosgoogle Retrieving Typed Data Using Ordinals ODP NET provides data specific enum
 

ODP.NET - Retrieving Data Using OracleDataReader

ODP NET Retrieving Data Using OracleDataReader OracleDataReader is simply a read only and forward only result set It works only if the database connection is open and it makes sure that the connection is open while you are retrieving data As the data that it retrieves is read only it is a bit faster
 

ODP.NET - Fundamental ODP.NET Classes to Retrieve Data

ODP NET Fundamental ODP NET Classes to Retrieve Data To retrieve data from an Oracle database using ODP NET we need to work with a few of the ODP NET classes At this point we will discuss the most fundamental classes available in ODP NET for retrieving data mosgoogle The following is the list of fun
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape