m working on shopping cart using csharp.
m retaining the products in datatable and finally then m showing this product in datalist(cart).
but the problem is that the datatable only keeps single row.
whenever i use to add new product to cart the old one is not shown only recently added product is shown.
plz guide where m i wrong.how to retain multiple rows in datatable.i used session but no change.
I believe that somewhere in your code you are overwriting the DataTable without preserving the older records .
Most possible place is where you are adding a new row,
just debug your code or post relevent pieces here ,
"Technically", the bug is here (your assigning a whole new datatable as your Session["cart"] object).
Session["cart"] = dt;
If your Session["cart"] schema is the same as dt just do:
But the whole thing is veerrry messsssyy....
Come on man, ever heard of Sql injection?
I see you use parameters in your Update method, good - use them all round your code, better yet, turn those sql strings into stored procedures.