title: How to stop thread in ThreadPool?
body: <p>I start a long operation (usually long query (SELECT) to database).
  It might take long time, and I want to add capability to stop this action.
  Code looks like:</p>
  
  <pre><code>ThreadPool.QueueUserWorkItem(a =&gt; action.DoLongAction());
  
  public void DoLongAction()
  {
      var sql = Tables.Where(el =&gt; el.Some == "XXX"); // dynamically constructed LINQ query to database
      var result = db.Query(sql);
  }
  </code></pre>
  
  <p>I can't use signals of flags, to stop this thread. Because, long operation isn't in my code, but in database process (sql query about 5 mins).</p>
  
  <p>How can I stop this thread correctly?</p>
  
  <p>UPD1. Not plain SQL, but LINQ (EF4, BLToolkit)</p>