简体   繁体   English

如何使用OPTION FAST绑定存储过程返回的前100条记录,而在后台它将获取剩余数据

[英]How to bind first 100 records returning by a stored procedure using OPTION FAST and in background it will take remaining data

I have to bind thousands of records in the front end using a stored procedure in SQL Server and C#. 我必须使用SQL Server和C#中的存储过程在前端绑定数千条记录。

When I am executing the SP in SQL Server then it is returning 100 records very quickly and then selecting remaining records. 当我在SQL Server中执行SP时,它会非常快速地返回100条记录,然后选择剩余的记录。

So can I bind those first 100 records in the front end so that the user doesn't have to wait for long and in the background it will fill remaining data in GridView? 因此,我可以将前端的前100条记录绑定到前端,以便用户不必等待很长时间,并且在后台它将在GridView中填充剩余数据吗?

Right now the user has to wait for so long and only once it has loaded all the records will the user be able to see this. 现在,用户必须等待很长时间,只有加载了所有记录后,用户才能看到此记录。

So can you please let me know how I can bind the first 100 records in the front end? 那么,能否让我知道如何绑定前端的前100条记录?

  • Use paging, enable paging and set page size to 100 so it will show only 100 rows of data when user click on second page it will display other 100 and so on 使用分页,启用分页并将页面大小设置为100,这样当用户单击第二页时它将仅显示100行数据,将显示其他100行,依此类推

  • You can also use limit in stored procedure set limit = 100 您还可以使用limit在存储过程中设置limit = 100

     SELECT * FROM TABLENAME LIMIT=100 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM