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

Which .NET framework supports Web API?

1103


How do you handle server controls?

1195


is there any third party tools are using in .net technologies? what are there ? give me the brief introduction?

2470


what are the Custom controls in asp.net?

1081


What is the difference between trace and debug in asp.net?

1187


Explain the difference between inline and code behind - which is best in?

1056


How many web config files can be created for an application?

906


How to disable cut, copy and paste in TextBox using jQuery in asp.net?

1251


What is the significance of attaching a profile while creating a user?

1110


How to prepare culture-specific formatting in .net.

1073


Write a code for sending an email from asp.net application.

1095


What is state management in asp.net with example?

1006


What is the significance of ASP.NET routing?

1121


What is cache in asp net?

1054


Explain difference between friend and protected friend?

971