title: Populating a GridView from a DataTable
body: <p>I am new ASP.NET and I have never used a GridView or DataGrid, but I cannot find helpful examples online on how to do what I need. I need some data to be displayed on a page and I know that I should use a GridView, but I cannot seem to get anything to display.</p>
  
  <p>I have the following DataSet:</p>
  
  <pre><code>DataSet ds = new DataSet("MyTables");
  ds.Tables.Add("Users");
  ds.Tables["Users"].Columns.Add("ID");
  ds.Tables["Users"].Columns.Add("Name");
  ds.Tables["Users"].Columns.Add("Email");
  ds.Tables["Users"].Rows.Add(0,"Ace","ace@example.com");
  ds.Tables["Users"].Rows.Add(1,"Biff","biff@example.com");
  ds.Tables["Users"].Rows.Add(2,"Chuck","chuck@example.com");
  ds.Tables["Users"].Rows.Add(3,"Dick","dick@example.com");
  myGrid.DataSource = ds.Tables["Users"].DefaultView;
  myGrid.DataBind();
  </code></pre>
  
  <p>Heres is my ASP.NET:</p>
  
  <pre><code>&lt;asp:GridView ID="myGrid" runat="server"&gt;
  &lt;/asp:GridView&gt;
  </code></pre>