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
Can a master page have more than one contentplaceholder?
Can I read the hard disk serial # of the client computer using asp.net?
What is the difference between custom web user control and a custom web server control?
can we remote debug applications with the remote debugger installed with vs.net 2002, with vs.net 2003?
Define reflection in .net?
What is round trip in asp.net?
What are app services?
What are the differences between application object and session object?
What is the difference between web config and machine config files?
What is the concepts of globalization and localization in .net?
Explain what are delegates?
What are the server controls in asp.net?
What r the asp.net list controls and diff. Between them?
Explain asp.net page life cycle?
What is the difference between a cookie and a pixel?