button_click() { DataTable dt = new DataTable(); if (!dt.Columns.Contains("itemId")) { dt.Columns.Add("itemId"); } ... ... if (!dt.Columns.Contains("TotalPrice")) { dt.Columns.Add("TotalPrice"); } if (Session["datatable"] != null) { dt = (DataTable)Session["datatable"]; } DataRow dr = dt.NewRow(); dr[0] = txtitemId.text() ... ... dr[4] = txtTotalPrice.text() dt.Rows.Add(dr); if (Session["datatable"] == null) { Session["datatable"] = dt; } rpt.datasource=dt; rpt.databind(); }
pre
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)