title: asp.net sql datareader loop by columns
body: <p>I have sql query in my asp.net webapp and the result is stored in datareader. Every row in datareader contains 10 columns. I want to fill table with these data. However, I have no idea, how to loop through columns in datareader. I need something like this:</p>
  
  <pre><code>while (vysledky.Read())
  {
      TableRow row = new TableRow();
      tab.Controls.Add(row);
      foreach (column in ((datareader(row)))  //it is not real code
      {
        TableCell cell = new TableCell();
        cell.Text = datareader(row).content;
        row.Controls.Add(cell);
      }
  }
  </code></pre>
  
  <p>I hope you got the point. Thanks</p>