以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]怎么在导过来的数据后增加合计数  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=61498)

--  作者:lrh9537
--  发布时间:2014/12/13 15:03:00
--  [求助]怎么在导过来的数据后增加合计数
怎么在如下代码中增加合计数

Dim dt1 As DataTable = DataTables("总人口")
Dim dt2 As DataTable = DataTables("村级一览表")
For Each dr As DataRow In dt2.DataRows
Dim filter As String = ""
If dr("单位") = "合计" Then
filter = "单位名称 = \'合计\'"
Else
filter = "单位名称 = \'" & dr("单位") & "\' and 组名称 = \'" & dr("组名称") & "\'"
End If
Dim fdr As DataRow = dt1.Find(filter)


For Each dc As DataCol In dt2.DataCols
If dr.IsNull(dc.Name) Then
If fdr IsNot Nothing AndAlso fdr.IsNull(dc.Name) = False Then
dr(dc.Name) = fdr(dc.name)
End If
End If
Next
Next


--  作者:y2287958
--  发布时间:2014/12/13 18:15:00
--  
上例子