我模仿了下 改了一下代码 但是出现一个问题
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "Select 竞争对手,刊物名称,出版日期,页码,版面,''As 次数 From {保健品竞品明细}"
Dim t As Table = e.Form.Controls("Table1").Table
t.StopRedraw
t.DataSource = cmd.ExecuteReader()
t.DataTable.DataRows.Clear()
Dim vals As List(Of String) = DataTables("保健品竞品明细").GetValues("竞争对手","竞争对手 Is Not Null")
msgbox(1)
For Each val As String In vals
Dim arys As List(Of String()) = DataTables("保健品竞品明细").GetValues("竞争对手|刊物名称|出版日期|版面|页码","刊物名称 = '" & val & "' And 竞争对手 Is Not Null and 出版日期 Is Not Null And 版面 Is Not Null And 页码 Is Not Null")
Dim r As Row
For Each ary As String() In arys
r = t.AddNew()
r("竞争对手") = ary(0)
r("刊物名称") = ary(1)
r("出版日期") = ary(2)
r("版面") = ary(3)
r("页码") = ary(4)
Next
r = t.AddNew()
r("次数") = arys.Count
Next
t.ResumeRedraw
我想实现
各竞争对手打了多少版次的广告!
但是出错

此主题相关图片如下:1.png
[此贴子已经被作者于2014-3-24 16:28:12编辑过]