根据客户要求逐步加载数据 [英] loading data step by step as per client requirement

查看:71
本文介绍了根据客户要求逐步加载数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以看到很多站点中的示例,它们会加载列表,显示一些有限的行,当我们点击更多按钮时,它会在同一列表中加载更多行。再次,如果我们点击更多按钮,它会加载更多行,并继续逐步加载直到列表结束。



i想在asp.net mvc中执行此操作



请提前帮助谢谢

we can see the examples in many sites that wile loading a list some limited rows are displayed, and when we hit the more button it loads some more rows in the same list. and again if we hit the more button it loads some more rows and it keeps on loading in steps till the list ends.

i want to do this in asp.net mvc

please help thanks in advance

推荐答案

假设您正在使用SQLServer,最好更改您的存储过程只返回您在任何特定时间而不是整个数据集中显示的记录数。



sproc的粗略模式将是类似......



Assuming that you're using SQLServer, it's better to change your stored procedure to just return the number of records that you require to display at any particular time rather than the whole data set.

The rough pattern for the sproc would be something like ...

CREATE PROCEDURE myQuery
  @Start INT,
  @End INT,
  -- Other parameters
AS
  SELECT ROW_NUMBER() OVER (ORDER BY orderField) AS RowNum, fieldList 
      FROM table
      WHERE RowNum >= @Start AND RowNum < @End
      ORDER BY RowNum





这会假设您的应用程序将执行分页计算,或者,如果您愿意,您可以将参数更改为PageNumber和RecordsPerPage并在存储过程中进行这些计算。



希望有所帮助。



That would suppose that your app will carry out the paging calculations, alternatively, you could, if you wished, change the arguments to PageNumber and RecordsPerPage and do those calculations in the stored procedure.

Hope that's of some help.


这篇关于根据客户要求逐步加载数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆