简体   繁体   English

C# SQL 查询连续返回结果

[英]C# SQL Query continous return of result

I don't have any code cause I don't know where to start with this and Google has not helped me with this one, let me explain.我没有任何代码,因为我不知道从哪里开始,谷歌也没有帮助我解决这个问题,让我解释一下。 If I use SQL Server Management Studio (SSMS) and execute a query which takes a significant amount of time it returns the rows continuously until the query has finished.如果我使用 SQL Server Management Studio (SSMS) 并执行一个需要大量时间的查询,它会连续返回行,直到查询完成。 I want to achieve the same result in C# as I have a web page that queries a database which can take some minutes to finish and instead for the users having to wait until the whole query has finished they could have this "incremental" result being displayed on the web page.我想在 C# 中获得相同的结果,因为我有一个查询数据库的网页,这可能需要几分钟才能完成,而对于必须等到整个查询完成的用户,他们可以显示这个“增量”结果在网页上。

You should implement pagination in your queries and then use an advanced datagrid component to load the data while scrolling.您应该在查询中实现分页,然后使用高级数据网格组件在滚动时加载数据。 Telerik could do something like that or you could create your own. Telerik 可以做类似的事情,或者你可以创建自己的。 Eg https://demos.telerik.com/aspnet-ajax/grid/examples/performance/virtualization/defaultcs.aspx例如https://demos.telerik.com/aspnet-ajax/grid/examples/performance/virtualization/defaultcs.aspx

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

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