title: Adding value to a datatable to the second column
body: <p>How can I add value from listbox2 to a second column "Date"? The code works, but it adds values to the first column "Name".</p>
  
  <pre><code>XmlTextReader reader = new XmlTextReader(cesta);
  XmlNodeType type;
  
  DataSet dsload = new DataSet();
  dsload.ReadXml(cesta);
  DataTable dt = new DataTable("MyTable");
  dt.Columns.Add(new DataColumn("Name", typeof(string)));
  dt.Columns.Add(new DataColumn("Date", typeof(DateTime)));
  
  while (reader.Read())
  {  
     if (reader.Name == "Name")
      {
          reader.Read();
          listbox1.Items.Add(reader.Value);
      }
  
      if (reader.Name == "Date")
      {
          reader.Read();
          listbox2.Items.Add(reader.Value);
      }
  
  }
  
  foreach (string value in listbox1.Items)
  {
      dr = dt.NewRow();
      dr[0] = value;
      dt.Rows.Add(dr);
  }
  data.DataSource = dt;
  
  foreach (string value in listbox2.Items)
  {
      dr = dt.NewRow();
      dr[0] = value;
      dt.Rows.Add(dr);
  }
  data.DataSource = dt; 
  </code></pre>