title: Filling a DataTable based on row values in a DataSet
body: <p>I want to show some news posts on the front page of a website. The news have different categories but are stored in the same mysql database. All news items are loaded into a dataset but from there I just want to extract some specific news and show them in a ListView control. </p>
  
  <p>At the moment I'am using the workaround solution of using a foreach loop on the dataset and formatting the result with html in the code behind. It works but I want all html formatting to be done in the aspx file, thus I'am looking for a better solution.</p>
  
  <pre><code>        DataSet articles = db.loadAllArticles();
          foreach (DataRow item in articles.Tables["articles"].Select("category = 1"))
          {
              result += "&lt;h1 class='headline'&gt;" + item["headline"] + "&lt;/h1&gt;&lt;h2 class='introduction'&gt;" + item["introduction"] + "&lt;/h2&gt;&lt;p class='content'&gt;" + item["content"] + "&lt;/p&gt;&lt;p class='authorAndDate'&gt;" + item["author"] + " " + item["datePosted"].ToString().Substring(0,10) + "&lt;/p&gt;&lt;br/&gt;";                  
          }
          lblDisplay.Text = result;
  </code></pre>
  
  <p>What I was hoping I could do was simply something like this:</p>
  
  <pre><code>DataSet articles = db.loadAllArticles();
  ListView1.DataSource = articles.Tables["articles"].Select("category = 1");
  ListView1.DataBind();
  </code></pre>
  
  <p>But the ListView control is not too happy about trying to bind DataRow to it or something.
  The best workaround I can think of is to create a new Table within the "articles" DataSet which contains only articles of the chosen category, so something like this:</p>
  
  <pre><code>DataSet articles = db.loadAllArticles();
  articles.Tables.Add("frontPageArticles");
  articles.Tables["frontPageArticles"] = ???
  </code></pre>
  
  <p>And then thats where it stops. How can I fill the new datatable with rows from the other datatable where the value of a column is x?</p>
  
  <p>-Eric.</p>