title: Reading an entire row from a .xls/.xlsx file with c#
body: <p>Im trying to read a .xls/.xlsx  file using a c# program I am using excel interop. However I can only read 1 cell at a time. Can someone show me how to read an entire row and put it inside a string?</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>Excel.Application xlApp = new Excel.Application();
  
                  Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(Path.GetFullPath("C:\\..\\A1.xlsx"));
  
                  Excel.Worksheet xlWorksheet = (Excel.Worksheet)xlWorkbook.Sheets.get_Item(1);
  
                  Excel.Range xlRange = xlWorksheet.UsedRange;
  string temp = (string)(xlRange.Cells[1,2] as Excel.Range).Value2;
                Console.WriteLine(temp);
  </code></pre>