Answer Posted / sivasaravanan
Data caching:
DataView Source;
//Declare variable for caching
Source = (DataView)Cache["MyDataset"];
if (Source == null)
{
OleDbConnection objcon = new OleDbConnection
(ConfigurationManager.ConnectionStrings
["strcon"].ConnectionString);
OleDbDataAdapter objcmd = new OleDbDataAdapter
("select * from Customer", objcon);
DataSet objds = new DataSet();
objcmd.Fill(objds, "Customer");
Source = new DataView(objds.Tables["Customer"]);
Cache["MyDataset"] = Source;
Label1.Text = "Dataset created explicitly";
}
else
{
Label1.Text = "Dataset retrived from Cache";
}
GridView1.DataSource = Source;
GridView1.DataBind();
gridbind();
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to improve performance of web application asp.net mvc? : Asp.Net MVC
Explain the different types of assemblies?
What are the Types of chaching. How to implement caching
In which event of the page life cycle, is the viewstate available?
What's the ASP.Net Application life cycle?
What are the differences between code behind and code inline?
What is asp.net file?
Explain the difference between dataset and datareader.
Define a web service in .net?
What’s the difference between asp.net web forms and asp.net mvc?
What is asp.net introduction?
What is a master page and what does it do?
Why Unload event of MasterPage Calls first in ASP.net ?
What are main return types supported in Web API?
What is query string? What are its advantages and limitations?