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
What is tracing? Where is it used?
What is the sequence in which ASP.NET events are processed?
Can the validation occurs in server-side or client-side? If the validation occurs why should we do?
Which protocol is used to call a web service?
What are custom user controls in asp.net?
What is the exact purpose of http handlers?
What is the compiled object?
Is asp.net 64-bit enabled? How?
What is an axd file?
Explain how can you debug your .net application?
Write a code snippet to implement the indentation in json in web api.
Explain the steps to be followed to use passport authentication.
Is it possible to create web application with both webforms and mvc?
How can you enable impersonation in the web.config file?
What are the different authentication modes in asp.net?