Shopping Cart DataSet Total Problem?
Posted on 2006-10-31
I've been using a session dataset to hold products and a cookie to hold the total.
How can I make the dataset hold the total as well?
I'm using this code to add the total to a row:
DataSet ds = (DataSet)Session["myds"];
DataRow row = ds.Tables["tbl_Sales"].NewRow();
row["col_Total"] = runningTotal.ToString();
However, I never know which row will contain the actual accurate running total.
The row will vary according to the number of products added before the row.
I use this code to retrieve the total although "Rows[3 -10]" varies
Amount.Text = ds.Tables["tbl_Sales"].Rows["col_Total"].ToString();