title: How to cancel Ado.Net async calls?
body: <p>I have a function to query database</p>
  
  <pre><code>private async Task&lt;IEnumerable&lt;T&gt;)&gt; RunQuery&lt;T&gt;(string sql)
  {
      using (var conn = new SqlConnection(_connStr))
      using (var cmd = new SqlCommand(sql, conn))
      {
          cmd.CommandType = CommandType.StoredProcedure;
          cmd.CommandTimeout = 300;
          await conn.OpenAsync().ConfigureAwait(false);
          var reader = await cmd.ExecuteReaderAsync().ConfigureAwait(false);
          // ... yield return the result from the reader
  </code></pre>
  
  <p>Some queries take a long time to run and I need to enable it to be cancelable (so it will release the database locks, etc). How to implement it?</p>