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
Which .NET framework supports Web API?
How do you handle server controls?
is there any third party tools are using in .net technologies? what are there ? give me the brief introduction?
what are the Custom controls in asp.net?
What is the difference between trace and debug in asp.net?
Explain the difference between inline and code behind - which is best in?
How many web config files can be created for an application?
How to disable cut, copy and paste in TextBox using jQuery in asp.net?
What is the significance of attaching a profile while creating a user?
How to prepare culture-specific formatting in .net.
Write a code for sending an email from asp.net application.
What is state management in asp.net with example?
What is the significance of ASP.NET routing?
What is cache in asp net?
Explain difference between friend and protected friend?