.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old February 26th, 2002, 06:04 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,578 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
how to sum up values stored in sessions

<i><b>Originally posted by : witold (wsokolow@poczta.onet.pl)</b></i><br />hi,<br /><br />i store values in several sessions e.g.<br /><br />session("item1") = "10"<br />session("item2") = "15"<br />session("item3") = "20"<br /><br />i need to add all the values up and get something like<br /><br />session("total") = session("item1") + session("item2")+ session("item3")<br /><br />i should end up with session("total") = "45" but<br />instead I get session("total") = "101520"<br /><br />Can anyone help me?<br /><br />witold<br />

Reply With Quote
  #2  
Old February 26th, 2002, 09:26 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,578 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Kurt (Kurt.Vandevelde@CMG.Be)</b></i><br />When you use Session("Item1"), the result is considered as a string. <br />Try<br />session("total") = CInt(session("item1")) + CInt(session("item2"))+ CInt(session("item3"))<br /><br />Kurt<br />------------<br />witold at 2/26/2002 4:04:18 AM<br /><br />hi,<br /><br />i store values in several sessions e.g.<br /><br />session("item1") = "10"<br />session("item2") = "15"<br />session("item3") = "20"<br /><br />i need to add all the values up and get something like<br /><br />session("total") = session("item1") + session("item2")+ session("item3")<br /><br />i should end up with session("total") = "45" but<br />instead I get session("total") = "101520"<br /><br />Can anyone help me?<br /><br />witold<br />

Reply With Quote
  #3  
Old February 26th, 2002, 09:42 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,578 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : witold (wsokolow@poczta.onet.pl)</b></i><br /><br />Thanks. One of my work colleagues has already prompted me with this solution. That's it!<br />It can be either cint(session("item1")) or<br />cint(request.form("item1")).<br /><br />Imagine I spent half a day looking for it and the answer's so simple:-)<br /><br />witold<br /><br />------------<br />Kurt at 2/26/2002 7:26:59 AM<br /><br />When you use Session("Item1"), the result is considered as a string. <br />Try<br />session("total") = CInt(session("item1")) + CInt(session("item2"))+ CInt(session("item3"))<br /><br />Kurt<br />------------<br />witold at 2/26/2002 4:04:18 AM<br /><br />hi,<br /><br />i store values in several sessions e.g.<br /><br />session("item1") = "10"<br />session("item2") = "15"<br />session("item3") = "20"<br /><br />i need to add all the values up and get something like<br /><br />session("total") = session("item1") + session("item2")+ session("item3")<br /><br />i should end up with session("total") = "45" but<br />instead I get session("total") = "101520"<br /><br />Can anyone help me?<br /><br />witold<br />

Reply With Quote
  #4  
Old February 26th, 2002, 08:43 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,578 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Andres Melguizo Velez (lucan@bigfoot.com)</b></i><br />The answer is ok! Just be careful with the kind of data that you are using, CInt() works with Integer values and you could need CDbl() for bigger or float values.<br /><br /><br />------------<br />witold at 2/26/2002 7:42:52 AM<br /><br /><br />Thanks. One of my work colleagues has already prompted me with this solution. That's it!<br />It can be either cint(session("item1")) or<br />cint(request.form("item1")).<br /><br />Imagine I spent half a day looking for it and the answer's so simple:-)<br /><br />witold<br /><br />------------<br />Kurt at 2/26/2002 7:26:59 AM<br /><br />When you use Session("Item1"), the result is considered as a string. <br />Try<br />session("total") = CInt(session("item1")) + CInt(session("item2"))+ CInt(session("item3"))<br /><br />Kurt<br />------------<br />witold at 2/26/2002 4:04:18 AM<br /><br />hi,<br /><br />i store values in several sessions e.g.<br /><br />session("item1") = "10"<br />session("item2") = "15"<br />session("item3") = "20"<br /><br />i need to add all the values up and get something like<br /><br />session("total") = session("item1") + session("item2")+ session("item3")<br /><br />i should end up with session("total") = "45" but<br />instead I get session("total") = "101520"<br /><br />Can anyone help me?<br /><br />witold<br />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > how to sum up values stored in sessions


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway