public partial class ShowProduct : System.Web.UI.Page{ public DataTable DT = new DataTable();protected void Button1_Click(object sender, EventArgs e) { AddNewRow(); GridView1.DataSource = (DataTable)Session["mySession"]; GridView1.DataBind(); } private void AddNewRow() { int Artnr = Convert.ToInt32(Request.QueryString.Get("Artnr")); LuftcoPbrytfjader myProduct; using (KlippexDataContext kc = new KlippexDataContext()) { myProduct = (from r in kc.LuftcoPbrytfjaders where r.Artnr == Artnr select r).Single(); DataColumn MyColumn; MyColumn = new DataColumn("Artikelnummer"); DT.Columns.Add(MyColumn); MyColumn = new DataColumn("Produktnamn"); DT.Columns.Add(MyColumn); MyColumn = new DataColumn("Pris"); DT.Columns.Add(MyColumn); DataRow MyRow = DT.NewRow(); MyRow[0] = myProduct.Artnr; MyRow[1] = myProduct.Produktnamn; MyRow[2] = myProduct.Pris; DT.Rows.Add(MyRow); DT.AcceptChanges(); Session["mySession"] = DT; } }}