//First Page where we store dataset values into caching and use that value another page...
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["kumarConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand("select Id,Name from emp", con);
SqlDataAdapter adp = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adp.Fill(ds);
Cache.Insert("user", ds);
/////second page access caching value..........
if (Cache["user"] != "")
{
ds = (DataSet)Cache["user"];
GridView1.DataSource = ds;
GridView1.DataBind();
}
Showing posts with label Cache object use for dataBase Access(Application Level Caching/Programmatic and Data Caching). Show all posts
Showing posts with label Cache object use for dataBase Access(Application Level Caching/Programmatic and Data Caching). Show all posts
Subscribe to:
Posts (Atom)