Hello, I'm trying to develop an ecommerce website using ASP.NET 2.0 with a shopping cart and checkout system. After customer has select products how do i store them into database and generate the receipt for customers for the product sold out just now and with an email sent to them?First you need to save the products that the user has selected and store them in memory. This can be done by storing the productID's in an arrayList or maybe Entity class and then putting it into the user's session. Later when the user checks out you simple retreive the list from the Session object and create an email message of what the user has purchased. Now since you already have all the information about the products in the Session object this won't be too hard.
Thank for helping. I just store the products that the user has selected in my table. How can i retrieve the primary key of the last product that i've insert?
If you want the primary key at the time when the product gets inserted you can use SCOPE_IDENTITY().
If you just want the last primary key inserted in the table you can use: IDENT_CURR('[TableName'])
0 comments:
Post a Comment