title: Iterate over datatable and assign values to different variables
body: <p>I have a datatable containing a list of 6 values. I want to iterate over this table and assign every new row value to a different variable. The table is filled by a class named DataTasks. </p>
  
  <p>This is how I do it at the moment, but I am sure there must be a better, more concise way?</p>
  
  <pre><code>DataTable dt = new DataTable();
  dt = DataTasks.CreateDataTableFromSQL(strSQL);
  // Loop counter
  int i = 0;
  
  foreach (DataRow row in dt.Rows)
  {
      // Assign ranges - this is where I hope to have better code!!
      switch(i)
      {
          case 0:
              SomeClass.Range1 = (int)row["Range"];
              break;
          case 1:
              SomeClass.Range2 = (int)row["Range"];
              break;
          case 2:
              SomeClass.Range3 = (int)row["Range"];
              break;
          case 3:
              SomeClass.Range4 = (int)row["Range"];
              break;
          case 4:
              SomeClass.Range5 = (int)row["Range"];
              break;
          case 5:
              SomeClass.Range6 = (int)row["Range"];
              break;
          default:
              break;
      }
  
      // Increment counter
      i++;
  }
  </code></pre>