Page 1 of 1

How to Cancel Linq Query

Posted: Mon 09 Aug 2010 06:49
by in4matiger
Hi,

It's possible to cancel a linq query?
If I use a OracleCommand and DataReader I can send a cancel().

I try
var Artikel = Manager.V003MATCH.AsParallel().WithCancellation(cs.Token);
the query is canceled to late

Regards

Posted: Tue 10 Aug 2010 11:56
by AndreyR
We will investigate the possibility to add the requested functionality.
I will post here about the results of our investigation.

Posted: Tue 14 Dec 2010 12:57
by AndreyR
We do not plan to add query canceling.
You can cancel materialization in the following way:

Code: Select all

      var query = from m in db.master select m;
      bool cancelRequested = true;
      foreach (var m in q) {
          if (cancelRequested)
              break;
      }