我想有一份所有间隔的总和,但我写这部法典,我有一处错误,称:使用未经签名的当地变量<条码>(<>全程/代码>?
enter TimeSpan total;
foreach (var grp in query)
{
TimeSpan interval = TimeSpan.FromMinutes(grp.Minuut);
TimeSpan intervalH = TimeSpan.FromHours(grp.Sum);
interval = interval + intervalH;
total += interval;
string timeInterval = interval.ToString();
dataGridView2.Rows.Add(i++, grp.Id, grp.Sum, grp.Minuut,timeInterval);
}