从客户端取消ADO.NET数据服务中的查询执行 [英] Cancellation of query execution in ADO.NET Data Service from client

查看:81
本文介绍了从客户端取消ADO.NET数据服务中的查询执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Silverlight应用程序(或典型的Windows / WPF应用程序)中,我需要运行长时间运行的查询。在某些情况下,用户需要取消长时间运行的查询。如何通过ADO.NET数据服务客户端实现这一目标?

问候,来自Madhanmohan S


来自印度的Madhanmohan S

Hi,
      In my Silverlight application(or typical Windows/WPF Application), I need to run long running queries. There are scenarios where user needs to cancel the long running query. How can this be achieved with ADO.NET Data Services client?

Regards,
Madhanmohan S


Madhanmohan S from India

推荐答案

启动查询后,您可以保留从BeginExecuteCall返回的IASYncREsult。
然后在dataServiceContext实例上调用CancelREquest来取消请求。
Once you kick off the query , you can hold the IASYncREsult returned from the BeginExecuteCall .
and then Call CancelREquest on the dataServiceContext instance to cancel the request.


这篇关于从客户端取消ADO.NET数据服务中的查询执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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