title: excel file reading one column and that rows continiously
body: <p>I have an excel file with two columns. I want to get one column and all its rows then 2nd column and all that rows. In the same way I should have those columns repeatedly of 12 columns.  </p>
  
  <p><img src="https://i.stack.imgur.com/2TfZv.jpg" alt="enter image description here"></p>
  
  <p>I have used below code but I am not getting required output where I am getting <code>Emp_name</code> in first column but I should get it in second column. </p>
  
  <pre><code>for (int Cnum = 1; Cnum &lt;= ShtRange.Columns.Count; Cnum++)
  {
  
      if (Cnum == 1)
      {
          dt.Columns.Add((ShtRange.Cells[1, Cnum] as Excel.Range).Value2.ToString());
          for (int Rnum = 1; Rnum &lt;= 9; Rnum++)
          {
              dt.Rows.Add((ShtRange.Cells[Rnum, 1] as Excel.Range).Value2.ToString());
  
          }
      }
      else if (Cnum == 2)
      {
  
          dt.Columns.Add((ShtRange.Cells[1, Cnum] as Excel.Range).Value2.ToString());
  
  
          for (int Rnum = 1; Rnum &lt;= 9; Rnum++)
          {
  
              dt.Rows.Add((ShtRange.Cells[Rnum, 2] as Excel.Range).Value2).ToString();
  
          }
      }
  </code></pre>