Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys, plz help me about this. I have a project using ASP.NET MVC3 and Entity Framework. My problem is customer's cart. When a customer login and they add some goods in his/her cart. I want to store them until they order it or cancel it. So should i use Temporary Table for each customer's cart or anything?.
Plz help me:D. Thank you very much.
Posted

1 solution

Following are some criteria to also consider while choosing the option:

1. Persistence requirement? Do you want to persist the information of cart for multiple log-ins?
2. What is expected load? how many users and cart would be storing at any given point of time?

Following are my suggestions:
1. Modify session to use Sql to store session and keep cart in session.
2. Modify session to out proc with ASPNet Session state service and keep cart data in session.
3. Design sql table schema to store the cart in database not the temp db, I would not suggest to store in tempdb as it would increase DBA activity like require you to increase the tempdb size and, cleanup of temp table would be tricky for you once you loose the session. This is the most tricky implementation and requires lot of coding.

Choose either option 1 or 2 based on the reply of criteria 1 & 2.

-Rohit
 
Share this answer
 
Comments
Corporal Agarn 22-Oct-12 11:36am    
I might add that one table can hold multiple users/carts depending on how it is designed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900