For Each nm As String In DataTables("haihe").sqlGetValues("部门村居")
Dim dr As DataRow = DataTables("zc").AddNew()
dr("部门村居") = nm
dr("宅基地面积") = DataTables("haihe").sqlCompute("sum(宅基地面积)","[部门村居] = '" & dr("部门村居") & "'")
dr("主房面积") = DataTables("haihe").sqlCompute("sum(主房面积)","[部门村居] = '" & dr("部门村居") & "'")
dr("附房面积") = DataTables("haihe").sqlCompute("sum(附房面积)","[部门村居] = '" & dr("部门村居") & "'")
Next
这段代码循环次数30次,数据量3万条,耗时6.67S,这样客户打开窗口时间过长,如何优化?