以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]查询与赋值并存  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=44630)

--  作者:chnfo
--  发布时间:2014/1/5 16:11:00
--  [求助]查询与赋值并存
Dim Dic As new Dictionary(of DataRowInteger)
Dim 
v As Double
For Each 
dr As DataRow In DataTables("表A").DataRows
    v = DataTables("表A").Compute("Count(第二列 )""第二列 = " & dr("第一列"))
    dic
.Add(drv

Next
For Each 
dr As DataRow In dic.Keys
    
dr("第四列") = dic(dr)
Next

这段代码中,为什么不将
Dim Dic As new Dictionary(of DataRowInteger)
直接定义为
Dim Dic As new Dictionary(of DataRowDouble)

否则V是double,而字典定义为integer,可能会导致数据截短.

--  作者:有点甜
--  发布时间:2014/1/5 21:11:00
--  
 呵呵,count得到的是整数,v应该定义成integer才对的。