如何在WCF中实现数据集的流启用 [英] How can achieve stream enabling for dataset in WCF

查看:76
本文介绍了如何在WCF中实现数据集的流启用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在网格中显示25万条记录。目前,在网格中加载所有数据需要5分钟。我想使用WCF的流媒体技术,以便一旦查询中的数据显示在屏幕上,查询处理就会在后台运行以检索其余的数据。

解决方案

< blockquote>你应该重新考虑在DataGrid中一次显示250万条记录是否真的有意义。谁应该在入睡前通读它? ;)



但是,如果你真的想继续这个想法:你不能一次流式传输整个DataSet并逐步显示它的到来部分 。为了重建对象,必须完全接收它。相反,你必须修改服务以在页面中发送记录,然后在它们到达时将这些记录添加到数据网格的数据源中(或者如果你在这里谈论Windows Forms和DataGridView)使用虚拟模式 [ ^ ]。



为此你可以但不必使用WCF流。我找到了一个可能有帮助的MSDN博客:自定义WCF流媒体 [ ^ ]

I want to display 25 lakhs records in a grid. Currently it takes 5 minutes to load all data in grid. I want to use streaming technique of WCF so that as soon as data available from query it will display on screen & query processing runs in background to retrieve rest of the data.

解决方案

You should reconsider if it really makes sense to display 2,5 million records at once in a DataGrid. Who is supposed to read through it before falling asleep? ;)

However, if you really want to proceed with that idea: You can't stream the whole DataSet at once and display the arriving "parts" of it incrementally. In order to reconstruct an object, it has to be received fully. Instead you have to modify the service to send the records in pages and then add these to the data source of the data grid as they arrive or (if you're talking Windows Forms and DataGridView here) use the DataGridView in VirtualMode[^].

For this you can but don't have to use WCF-streaming. I found an MSDN-Blog that might be helpful: Custom WCF Streaming[^]


这篇关于如何在WCF中实现数据集的流启用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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