ASP.NET - how to temp table for online purchase foreach user with out login

Asked By mani on 23-Jun-12 01:57 AM
hi..i am developing online purchase after selecting multiple product before login..i need to save and disply their selected product for each customer at the time of selecting product in purchase list..how to use this concept..if i use temp table it will show product of one user to another user wrongly..how to solve this ??any help??
Ravi Maurya replied to mani on 23-Jun-12 02:06 AM
How can you maintain the users without login, one thing you can do is make use of session with datatable any changes make in the cart update your datatable and save it in the session.

Hope you get the logic. Feel free to ask further quires.
mani replied to Ravi Maurya on 23-Jun-12 03:09 AM
no;.user will select product and get list with out login...so payment only use after login..
Vikram Singh Saini replied to mani on 23-Jun-12 04:56 AM
For your requirement, I would suggest you to use Profile in asp.net

<anonymousIdentification enabled="true"/>
      <profile enabled="true">
        <properties>
          <add name="Color" type="System.String" defaultValue="blue" allowAnonymous="true"/>
          <add name="Number" type="System.Int32" defaultValue="42" allowAnonymous="true"/>            
        </properties>
      </profile>


In this way you can maintain purchase information for each user (anonymous user too). And when they login you can use the same information in that scenario.
kalpana aparnathi replied to mani on 23-Jun-12 07:05 AM
hi,

You can use the TEMPORARY keyword when creating a table.A TEMPORARY table is visible only to the current connection, and is dropped automatically when the connection is closed.This means that two different connections can use the same temporary table name without conflicting with each other or with an existing non-TEMPORARY table of the same name.

Regards,