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 http post and http get?
How response object is related to asp's response object?
What is a 307 redirect?
Can one dll file contains the compiled code of more than one .net language?
Can anyone please tell me that the question posted on this website are Sufficient for the interview with 2+ year experience in .net
What is the difference between runtime version and version?
How many types of cookies are there in asp.net?
What is the difference between session and viewstate?
What is difference between viewstate and session state in javascript?
What should you do is you want to remove an existing component but would like to make some funtionalities?
Explain asp.net mvc request life cycle? : asp.net mvc
What are the two Layouts supported by a Web form in ASP.NET?
How many types of state management are there in asp net?
Explain the difference between panel and groupbox classes using .net?
can we remote debug applications with the remote debugger installed with vs.net 2002, with vs.net 2003?