Caching Records in Memory with ASP.NET
Hello, I am learning ASP.NET programming language. And while learning it, I have come to know that it is possible to catch the records from the memory. I am not able to understand the basic concept behind this, so if you are having idea about it, then please help me to achieve it. It will be helpful to me to know about it. If you know the sources from which I can able to get more knowledge about the same then also please provide help about it.
Re: Caching Records in Memory with ASP.NET
Hello, if you want to cache the data in memory then you need to create the method which will take into account the memory for the given number of time. And between that much period that data is displayed into the memory and so it will provide more faster response to the any type of query. And if the time period is complete then the data from the cache is refreshed and thus it can contain the new or fresh data in the memory.
Re: Caching Records in Memory with ASP.NET
Hey, while searching about your question I have got the below mentioned code which will help you to store or get the object virtually from the AppDomain and for that you must need to make use of the code below:
Code:
System.AppDomain.CurrentDomain.SetData("NewData", Type)
Type =(Type) System.AppDomain.CurrentDomain.GetData("NewData")
Re: Caching Records in Memory with ASP.NET
Hello, if you want to know the details about the Caching Records in Memory with ASP.NET, then you must need to make use of the code below:
Code:
<%
Function Disp()
Const Text = &H0001
Dim sqlq, connection , result
sqlq = "SELECT id, FName, lLName FROM Names"
Set connection = Server.CreateObject("ADODB.Connection")
connection .Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _
Server.MapPath("CacheDemo.mdb")
Set result = Server.CreateObject("ADODB.Recordset")
result.Open sqlq, connection , 2, 4, Text
If Not result.EOF Then
Dim variable
variable = "<table width=""90%"" align=""center"""
variable = variable & " border=""1"" bordercolor=""silver"""
variable = variable & " cellspacing=""2"" cellpadding=""0"">"
variable = variable & "<tr bgcolor=""#CCDDEE""><td width=""5%"""
variable = variable & ">ID</td><td>Firesultt Name</td>"
variable = variable & "<td>Last Name</td></tr>"
While Not result.EOF
variable = variable & "<tr><td bgcolor=""#CCDDEE"">"
variable = variable & result("ID") & "</td><td>" & result("FName")
variable = variable & "</td><td>" & result("lLName")
variable = variable & "</td></tr>"
result.MoveNext
Wend
variable = variable & "</table>"
Disp = variable
Else
Disp = "Data Not Available."
End If
result.Close
connection .Close
Set result = Nothing
Set connection = Nothing
End Function
%>
Re: Caching Records in Memory with ASP.NET
Hello, if you want to make use of the faster response while making use of the web application then it is necessary to use the Caching records in memory with Asp.net. Most of time this technique is used by the developer for getting faster working of the web site. It is having following two types of caching:
- Output Caching
- Data Caching
Re: Caching Records in Memory with ASP.NET
Hello, if you make use of the code below then you will come to know the details about the caching records in memory with ASP.NET
Code:
If (args == "site") then
dim Name as string = _
Context.Request.Browser.Browser + Context.Request.Browser.MajorVersion.ToString()
return Name
Else if (args=="SomeCustomString") then
Else MyBase.GetVaryByCustomString(context, args)
End If
End Function