我正在尝试将所有组加载到Array
然后循环遍历这些组,并查看每个代理有多少资产,如果资产不仅仅是代理而不是将它们移动到我们的虚拟组 0。但我对此并不陌生,DataSet
并且TableAdapator
.
基本上是集团--代理--资产
0--0--10
1--3--3
2--3--5
3--10--15
所以第 2 组有 2 个额外资产我想将它们移动到我们的空组 0
请指导
Dim rs, lines
rs = cn.Execute("select grp from tskmsgrp where listid = 0;")
Dim da As New System.Data.OleDb.OleDbDataAdapter()
Dim da_line As New System.Data.OleDb.OleDbDataAdapter()
Dim ds As New DataSet()
da.Fill(ds, rs, "grp")
MsgBox("There are total products." & ds.Tables(0).Rows.Count.ToString)
For Each a As DataRow In ds.Tables(0).Rows
lines = cn.Execute("select count(*) from tsklines where grp ='" & a(0) & "';")
Dim ds_lines As New DataSet()
da_line.Fill(ds_lines, lines, "lines")
MsgBox("Lines for group." & a(0) & " -- " & ds_lines.Tables(0).Rows.Count.ToString)
Next