if(session["cart"]!=null) {
DataTable da = new DataTable();
DataTable dtb = (DataTable)Session["cart"];
da = dtb.Clone();
DataRow dr = da.NewRow();
dr["ProductName"] = ds.Tables[0].Rows[0]["ProductName"];
dr["ProductImages"] = ds.Tables[0].Rows[0]["ProductImage"];
dr["Price"] = ds.Tables[0].Rows[0]["Price"];
da.Rows.Add(dr);
foreach(DataRow row in da.Rows )
{
d
t.ImportRow(row);
}
return dt;
}
Here dt comes with an Emptydata..............
Structure of datatable dt is .......
dt.Columns.Add("ProductImages", typeof(string));
dt.Columns.Add("ProductName", typeof(string));
dt.Columns.Add("Price", typeof(double));