cmd.CommandText = "SelecXX Count(*) From {工作单} And 责任人= '" & Username1 & "'"
Dim Count As Integer = cmd.ExecuteScalar() '获取总的行数
Dim Pages As Integer = Math.Ceiling(Count/PageRows) '计算出总页数
cmd.CommandText = "Selec * From (SelecXX Row_Number() Over(Order by 完成时间) As [NO.],[_Identify],责任单位,完成时间,工作内容,责任人 From 工作单 where 责任人= '" & Username1 & "') As a "
cmd.CommandText = cmd.CommandText & " Where [NO.]>= " & StartRow & " And [NO.] <= " & EndRow