title: Looping through data table to get value
body: <p>I have a DataTable with multiple rows. I'm using a foreach loop to loop through each item and return the name. This is returning the same (1st) value for each row. What have I done wrong?</p>
  
  <pre><code>            DataTable table = new DataTable();
              table.Columns.Add("tag", typeof(string));
              string name = hfSelected.Value;
              string[] names = name.Split(',');
              for (int i = 0; i &lt; names.Length; i++)
                  table.Rows.Add(new object[] { names[i] });                  
              DataRow row = table.Rows[0];
  
              foreach (var item in table.Rows)
              {
  
                  Value = row["tag"].ToString() // this is returning the same value for both items in the table.
  
              }
  </code></pre>