dim sql as string =
"S elect 工程名称,sum(发货量) as 发货量 From {销售出库} where " & flt & " GROUP BY 工程名称"
Dim cmd As New SQLCommand
cmd.C '记得设置数据源名称
cmd.C ommandText = "S elect count(*) from (" & sql& ") as a"
Dim Count As Integer = cmd.ExecuteScalar() '获取总的行数
cmd.C ommandText = "S elect * From (S elect Row_Number() Over(Order by 工程名称) As 序号,工程名称,发货量 From (" & sql & ") as b ) as a where 序号>= " & StartRow & " And 序号 <= " & EndRow
[此贴子已经被作者于2020/3/22 22:05:57编辑过]