con.ConnectionString = ConfigurationManager.ConnectionStrings["sqlcon"].ConnectionString;
SqlCommand cmd = new SqlCommand("select * from sample", con);
SqlDataAdapter dr = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
dr.Fill(ds, "sample");
datagrid.DataSource = ds;
datagrid.DataBind();
Cache.Insert("sample", ds);
No comments:
Post a Comment