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

What is http post and http get?

959


How response object is related to asp's response object?

852


What is a 307 redirect?

852


Can one dll file contains the compiled code of more than one .net language?

954


Can anyone please tell me that the question posted on this website are Sufficient for the interview with 2+ year experience in .net

1977


What is the difference between runtime version and version?

979


How many types of cookies are there in asp.net?

906


What is the difference between session and viewstate?

905


What is difference between viewstate and session state in javascript?

1051


What should you do is you want to remove an existing component but would like to make some funtionalities?

1880


Explain asp.net mvc request life cycle? : asp.net mvc

978


What are the two Layouts supported by a Web form in ASP.NET?

1017


How many types of state management are there in asp net?

981


Explain the difference between panel and groupbox classes using .net?

915


can we remote debug applications with the remote debugger installed with vs.net 2002, with vs.net 2003?

2101