调试技巧:http://www.foxtable.com/webhelp/scr/1485.htm
到服务端命令窗口执行调试
Dim dt As DataTable
Dim cmd As new SQLCommand
cmd.ConnectionName = "订单管理系统"
cmd.CommandText = "Select year(订单日期) As 年, month(订单日期) As 月, max(订单编号) As 订单编号 From{订单明细表} group by year(订单日期) , month(订单日期)"
dt = cmd.ExecuteReader
ddbhs.Clear()
For Each dr As DataRow In dt.DataRows
Dim ny As String = dr("年") & Format(dr("月"),00)
Dim bh As String = dr("订单编号")
output.show(ny & "--" & bh)‘看都是什么数据
Dim id As Integer
If bh .length = 11 Then
bh = bh .SubString(7)
If Integer.Tryparse(bh ,id) Then
ddbhs.add(ny ,id)
End If
End If
Next
或者执行下面看看
For Each key As String In ddbhs.keys
Output.Show(key & "=" & ddbhs(key))
Next