title: Querying a datatable with top clause
body: <p>I am implementing paging in my datalist. (visual studio 2008)</p>
  
  <p>For that i have datatable on which i want to make query for paging.</p>
  
  <p>I have following datatable:</p>
  
  <p><img src="https://i.stack.imgur.com/xOGNc.png" alt="enter image description here"></p>
  
  <p>I wanted to implement following SQLquery:</p>
  
  <pre><code>select top 5 * from (select   ROW_NUMBER() OVER (ORDER BY Index) as Row from users) T where Row &gt; " 10
  </code></pre>
  
  <p>I want to make same query on this datatable as above.</p>
  
  <p>I was confused how to use "top" to query datatable.</p>
  
  <p>For that i made following attempt:</p>
  
  <pre><code>DTResult.Select("Index &lt; " &amp; Integer.Parse(ddlPage.SelectedValue.ToString()))
  </code></pre>
  
  <p>(note: <code>ddlPage</code> is my dropdown containing numbers for paging like 5,10,25,etc)</p>
  
  <p>This attempt is not giving me intended result.</p>
  
  <p>please help me.</p>