//Display the all of the product in the cart and the toal cost public void showCart(double totalcost) { String sql = "SELECT cart FROM TP_Customer WHERE customer_id = '" + Session["customerID"].ToString() + "'"; objDB.GetDataSet(sql); //if (objDB.GetField("cart", 0) != System.DBNull.Value) //{ // // De-serialize the binary data to reconstruct the CreditCard object retrieved // // from the database // Byte[] byteArray = (Byte[])objDB.GetField("cart", 0); // BinaryFormatter deSerializer = new BinaryFormatter(); // MemoryStream memStream = new MemoryStream(byteArray); // Product product = (Product)deSerializer.Deserialize(memStream); // productlist = (ArrayList)Session["Productlist"]; // productlist.Add(product); // gvCart.DataSource = productlist; // gvCart.DataBind(); //} //else if (objDB.GetField("cart", 0) == System.DBNull.Value) //{ //} gvCart.Columns[0].FooterText = "Total"; gvCart.Columns[4].FooterText = totalcost.ToString("C2"); productlist = (ArrayList)Session["Productlist"]; gvCart.DataSource = productlist; String[] productid = new string[1]; productid[0] = "product_id"; gvCart.DataKeyNames = productid; gvCart.DataBind(); }