title: asp.net include pagination in dynamically generated table
body: <p>I have existing client code wherein sql data reader is being used to pull records from a database and in code behind, table content is being generated as string and then assigned to a  asp:literal element on the page.</p>
  
  <pre><code>Dim myreader As SqlDataReader = selectcmd.ExecuteReader
  
  If myreader.HasRows Then
  str = str &amp; "" // str is string
  
  While myreader.Read()
  If Not IsDBNull(myreader("column1")) Then
    str = str &amp; "&lt;tr&gt;&lt;td align=left&gt;&lt;font color=white&gt;" &amp; myreader("column1") &amp; "&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"
  End If
  End While
  
  // in the end string is assigned to Text attribute of asp:literal element
  </code></pre>
  
  <p>The client wants that pagination should be used, and that only 10 rows should be visible at a time and rest should be viewed via paging.</p>
  
  <p>Can anyone suggest how this can be achieved.</p>
  
  <p>Thanks.</p>