title: SQL query times out after 30 seconds regardless of config settings
body: <p>The problem is that I'm getting a timeout error while querying the database in a <strong>for loop</strong> to fetch paginated set of records. Each loop is not expensive, but querying for more than 30 seconds using the same connection object gives the transaction/timeout error : </p>
  
  <p>I've tried adding commandTimeout property for Dapper query, and Connection Timeout in app.config (both being above 30 seconds), but it doesn't affect anything. </p>
  
  <pre><code>int pages = totalCount / pageSize;
  for(int pageNumber = 1; pageNumber &lt;= pages; pageNumber++){
    string sql = @"select * from MyTable order by 1 desc offset @pageSize * (@pageNumber-1) rows fetch next @pageSize rows only;";
   _connection.Query&lt;MyEntity&gt;(sql, param: new {pageSize, pageNumber}).ToList();
  }
  
  </code></pre>
  
  <blockquote>
    <p>The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements</p>
  </blockquote>