Click here to Skip to main content
13,256,123 members (30,677 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I got this select

var qDuration = from rowU in DataAccess.metadata.um_User
                                join rowLC in DataAccess.metadata.um_CallLog
                                on rowU.userID equals rowLC.userID
                                group rowLC by new { userID = rowLC.userID } into groupN
                                select new
                                    userID = groupN.Key.userID,
                                    noOfCalls = groupN.Count(),
                                    totDurationSec = (from row in groupN
                                                      select row.Duration.Seconds).Sum(),
                                    totDurationMin = (from row in groupN
                                                      select row.Duration.Minutes).Sum(),
                                    totDurationHours = (from row in groupN
                                                      select row.Duration.Hours).Sum(),
now I wanna populate my time span with sums I did in this select

var qTime = new TimeSpan(1, 0, 0);
             string Dislay = qTime.ToString()
Posted 20-Feb-13 1:48am
Updated 20-Feb-13 2:03am
Joezer BH39.1K
Sandeep Mewara 20-Feb-13 9:17am
And... the issue is?
kolisa 20-Feb-13 10:04am
i have separated by min,hr,sec sum ,how can i combine those to get 0:00:00 in timespan

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you have separated the hours, minutes and seconds, just call:

<pre lang="cs">var qTime = new TimeSpan(HOURS, MINUTES, SECONDS);
                string Dislay = qTime.ToString()

kolisa 21-Feb-13 1:56am
my problem I can access the,totDurationSec cos they are inside a select and I cant make them global

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171114.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100