title: How to read data from Excel file in C#?
body: <p>I create an Excel file from c# with data validation-it seem like combo with chosen possibility</p>
  
  <pre><code>string mList1 = "=ProductCode";
                  oRng = oSheet.get_Range("H8", "H9");
                  oRng.Name = "ProductCode";
                  int t = dt.Rows.Count + 2;
                  string st = "F" + t;
                  oRng = oSheet.get_Range("F2", st);
                  oRng.Validation.Add(XlDVType.xlValidateList, 
                      XlDVAlertStyle.xlValidAlertStop, 
                      Missing.Value, mList1, Missing.Value);
  </code></pre>
  
  <p>Now I want to read the Excel file and also the chosen item from the combo. I have successfully read all the data but the data validation.</p>
  
  <p>Read the data-</p>
  
  <pre><code>Microsoft.Office.Interop.Excel.Application ExcelObj = null;
              ExcelObj = new Microsoft.Office.Interop.Excel.Application(); 
              Microsoft.Office.Interop.Excel.Workbook theWorkbook = ExcelObj.Workbooks.Open("C:\\Documents and Settings\\rachelg\\My Documents\\xxx.xls"
              ,Type.Missing, Type.Missing, Type.Missing, Type.Missing,
              Type.Missing, Type.Missing, Type.Missing, Type.Missing,
              Type.Missing, Type.Missing, Type.Missing, Type.Missing,
              Type.Missing, Type.Missing);
  
              Microsoft.Office.Interop.Excel.Sheets sheets = theWorkbook.Worksheets;
              Microsoft.Office.Interop.Excel.Worksheet worksheet = (Microsoft.Office.Interop.Excel.Worksheet)sheets.get_Item(1);
              for(int x = 1; x &lt;= 5; x++)
              {  
               string sd = ((Microsoft.Office.Interop.Excel.Range)worksheet.Cells[x, 1]).Text.ToString();
                  System.Console.WriteLine(sd);//this one column
  }
  </code></pre>
  
  <p>in different column I have the data validation but I don't know to access into it.</p>