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 do we implement bundling in MVC?
What’s the difference between response .redirect and server.transfer?
What threading model used in asp and asp.net?
Explain the boxing and unboxing concept in .net?
What is the difference between the response.write() and response.output.write() methods?
If you have an application with multiple security levels though secure login and my ASP.NET web appplication is spanned across three web-servers by using round-robbin load balancing. Explain which is the best approach to maintain login-in state for the users?
What are session state modes in asp.net?
To add a hyperlink column to the DataGrid which tag is used ?
What kind of data we can store in viewstate?
What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?
Whats the difference between abstract factory pattern and factory pattern?
Can a master page have more than one contentplaceholder?
How would you implement inheritance using c#?
What is asp.net ajax?
Why do we use datasource in asp.net?