How to get the time-span of all the datetime data in my datagridview

后端 未结 2 1588
闹比i
闹比i 2021-01-29 05:55

The scenario go\'s like that, above and this; I have a database, which I displayed on my datagridview. I already added the timespan of each row (timeIn and timeOut<

2条回答
  •  醉话见心
    2021-01-29 06:32

    You have your time in and time out, so create a TimeSpan and run a loop:

    TimeSpan timeSpan = new TimeSpan(0);
    // for each data grid row calculate and add the timespan:
        timeSpan =+ time_Out.Subtract(time_In);
    //
    

提交回复
热议问题