dt=new datatable();
ad=new sqldatadapter("select * from table",con)
ad.fill(dt);
Session["dataset"] = dt;
if(dt.rows.count>0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
and now transferring the data from one page grid to another page
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
loadgrid();
}
}
private void loadgrid()
{
DataTable dset = new DataTable();
dset = (DataTable)Session["dataset"];
if (dset.Rows.Count > 0)
{
GridView1.DataSource = dset;
GridView1.DataBind();
}
}
regards,
Anilkumar.D