Click here to Skip to main content
15,940,246 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i prevent duplicate record in session in c#
Posted
Comments
Sandeep Mewara 29-Sep-10 2:59am    
Casn you add more to your question about what you mean by 'duplicate record in session'?


Can you explain bit more about your query..

if (Session["sessionname"] == null) { not exist; } else { exist; }


This what you looking for or something else?

more about sessions refer link:
http://www.java2s.com/Code/ASP/Session-Cookie/StoreyourObjectinSessionC.htm[^]

 
Share this answer
 
Session itself stores objects,
if you don't want to have duplicate value in the object (e.g datatable) then check the record before inserting to them,

For better understanding look at the award winning article of abhijit jana.

Exploring Session in ASP.Net[^]

Please vote and Accept Answer if it Helped.
 
Share this answer
 

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