Code: Select all
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)));