//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();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment