protected void Cartbtn_Click(object sender, EventArgs e) { ProductDescriptionObject.SelectedProductSNo = Convert.ToInt16(ProductSNo); DataTable dtProducts = ProductDescriptionObject.GetProductsOnTheBaseOfProductId(); DataTable dt = new DataTable(); //storing all of the records dt.Columns.Add("ProductSNo", typeof(string)); // adding the columns dt.Columns.Add("ProductName", typeof(string)); dt.Columns.Add("ProductDescription", typeof(string)); dt.Columns.Add("ProductPrice", typeof(int)); dt.Columns.Add("ProductImage", typeof(Image)); dt.Columns.Add("ProductQuantity", typeof(string)); // dt.Columns.Add("AvailableStock", typeof(string)); DataRow dr = dt.NewRow(); //adding the rows dr["ProductSNo"] = ProductSNo; dr["ProductName"] = Convert.ToString(dtProducts.Rows[0]["ProductName"]); dr["ProductDescription"] = Convert.ToString(dtProducts.Rows[0]["ProductDescription"]); dr["ProductPrice"] = (dtProducts.Rows[0]["ProductPrice"]); dr["ProductImage"] = (dtProducts.Rows[0]["ProductImage"]); dr["ProductQuantity"] = ProductQuantity; // dr["AvailableStock"] = lblAvailableStock.Text; dt.Rows.Add(dr); //adding the data row in the data table. Session["MyCart"] = dt; //asigning the datatable in the session. ItemsCountInCartLinkBtn.Text = dt.Rows.Count.ToString(); } }
Image
byte[]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)