【发布时间】:2011-04-08 23:26:59
【问题描述】:
如何获得数据表中所有列的总和?假设我有下表。如何计算“总”行?将总行添加到数据表应该很容易。
Columns hits uniques sigups, etc...
Rows
1 12 1 23
2 1 0 5
3 6 2 9
total 19 3 37
更新
我结束了这个。这是我唯一可以开始工作的事情。
For Each col As DataColumn In TotalsTable.Columns
If col.DataType.Name = "DateTime" Then
count = count + 1
Continue For
End If
Dim colTotal As Double = 0
Dim value As Double
For Each row As DataRow In TotalsTable.Rows
If Double.TryParse(row(col), value) Then
colTotal += Double.Parse(row(col))
End If
Next
totalRow(count) = colTotal
count = count + 1
Next
【问题讨论】: