且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

超时已过期。 complet之前经过的超时时间...错误Occure

更新时间:2023-02-26 16:33:25

如果您使用的是SQL Server 2012,则可以使用ORDER BY子句的OFFSET和FETCH参数。请参阅 ORDER BY子句(Transact-SQL)



检索前20行


If you are using SQL Server 2012, you could use the OFFSET and FETCH arguments of the ORDER BY clause. See ORDER BY Clause (Transact-SQL)

Retrieves first 20 rows

select * from people order by lastname,firstname offset 0 rows fetch next 20 rows only





检索接下来的20行




Retrieves next 20 rows

select * from people order by lastname,firstname offset 20 rows fetch next 20 rows only





那说,我觉得任何阙在一个在线业务应用程序中,返回与查询一样多的行应该应用其他选择条件,以大大减少检索的行数。您的用户可能不希望一次分页40,000行20。这是下一步的2,000次点击。让用户花时间让他们使用其他选择标准来选择他们真正需要看到的那几行时,会更加考虑。



That said, I think that any query in an online business application that returns as many rows as your query should have additional selection criteria applied to greatly reduce the number of rows retrieved. Your user probably does not want to page through 40,000 rows 20 at a time. That is 2,000 clicks on Next. It would be more considerate of your user's time to let them use additional selection criteria to select only those few rows that they really need to see.


增加超时不是***解决方案。 。 Mike在他的解决方案中指出了一种采用按需加载方法来获取记录的好方法。我的建议也是一样的。

添加一个链接供你参考,作为这种方法之一。



HTTP://www.aspsnippets .com / Articles / on-demand-data-in-GridView-on-scroll-using-ASPNet-and-jQuery-AJAX.aspx [ ^ ]



希望这有帮助......
Increasing the timeout is not a optimal solution for this . Mike in his solution have pointed out a good way to have a Load on Demand approach for fetching the records. My suggestion would be also the same.
Adding a link for your reference as one of the way to this approach.

http://www.aspsnippets.com/Articles/Load-on-demand-data-in-GridView-on-scroll-using-ASPNet-and-jQuery-AJAX.aspx[^]

Hope this helps...