User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 430,115 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,265 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 446 | Replies: 1
Reply
Join Date: Aug 2007
Posts: 21
Reputation: ritika_khanna is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
ritika_khanna ritika_khanna is offline Offline
Newbie Poster

total amount

  #1  
Jan 6th, 2008
i am working on online railway reservation project in vb.net. i want to know after entering reservation details by user in a table where user can made only 6 person's reservation e.g train_no,source,destination,name,class,berth,age, senior citizen then how to calculate sum of ticket price of all the 6 persons when button is clicked.and how to display total amount on next page please send me this code
urgently.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: England
Posts: 153
Reputation: ptaylor965 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Re: total amount

  #2  
Jan 6th, 2008
Assuming that you are using a datatable(SQLTable) and you have a column like "ticket_price" for each person then you can use a span to show the total

In ASPX
<span id="lblTotal" runat="server">Total</span>

In Code
Dim Row as DataRow
Dim Total as Decimal = 0

For Each Row in SQLTable.Rows
   Total = (Total + Row("ticket_price"))
Next

lblTotal.innerhtml = Total
Peter Taylor
Visual Basic.NET Application Developer

TaylorsNet
http://www.taylorsnet.co.uk
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 3:15 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC