Dim s As Date = Date.Now()
Dim t As New DataTableBuilder("temp") '创建临时表
t.AddDef("字符", GetType(String), 32)
t.TableVisible = false
t.Build()
DataTables("统计").DataRows.Clear()
For i As integer = 1 to 10
dim f As New Filler
f.SourceTable = DataTables("自由统计数据二") '指定数据来源
f.SourceCols = "姓名" & i '指定数据来源列
f.DataTable = DataTables("temp") '指定数据接收表
f.DataCols = "字符" '指定数据接收列
f.Distinct = false
f.Fill() '填充数据
Next
dim f1 As New Filler
f1.SourceTable = DataTables("temp") '指定数据来源
f1.DataTable = DataTables("统计") '指定数据接收表
f1.ExcludeNullValue = true
f1.Fill() '填充数据
For Each dr As DataRow In DataTables("统计").DataRows
Dim sum As Integer = 0
For i As integer = 1 to 10
sum = sum + DataTables("自由统计数据二").Compute("sum(数据" & i & ")", "姓名" & i & " = '" & dr("字符") & "'")
dr("出现次数") = sum
Next
Next
Messagebox.Show("处理完毕! 耗时: " & (Date.Now -s).TotalSeconds)
[此贴子已经被作者于2009-12-19 23:52:46编辑过]