Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to implement caching?

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


Please Help Members By Posting Answers For Below Questions

How to improve performance of web application asp.net mvc? : Asp.Net MVC

1024


Explain the different types of assemblies?

962


What are the Types of chaching. How to implement caching

1025


In which event of the page life cycle, is the viewstate available?

979


What's the ASP.Net Application life cycle?

1110


What are the differences between code behind and code inline?

1103


What is asp.net file?

1204


Explain the difference between dataset and datareader.

1015


Define a web service in .net?

1065


What’s the difference between asp.net web forms and asp.net mvc?

1172


What is asp.net introduction?

1014


What is a master page and what does it do?

928


Why Unload event of MasterPage Calls first in ASP.net ?

1049


What are main return types supported in Web API?

1396


What is query string? What are its advantages and limitations?

981