View Single Post
  #6 (permalink)  
Old November 23rd, 2009, 11:02 PM
Bob Bedell Bob Bedell is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Actually, I believe all you need is:

Code:
long totalMinutes = 0;
foreach (DataRow row in dtLessHrs.Rows) 
{
  string[] split = row[0].ToString().Split(':');
  totalMinutes += (Int64.Parse(split[0]) * 60) + (Int64.Parse(split[1]));
}
lblTotalLessHrs.Text(String.Format("Total Less Hours = {0:00}:{1:00} (hours/minutes)", 
totalMinutes / 60, (totalMinutes % 60)));
The Following User Says Thank You to Bob Bedell For This Useful Post:
abhishekkashyap27 (November 27th, 2009)