title: Take contents of an excel file (.xls or .xlsx) in to Dataset
body: <p>i have an excel file named test.xls and i want to get the contents in the excel sheet into a Dataset.Is it possible
  i tried a code but it throws exception,here is my code</p>
  
  <pre><code> string FilePath = Server.MapPath("portals\\_default") + "\\" + upprice.FileName;
   upprice.PostedFile.SaveAs(FilePath);
   FileStream stream = File.Open(FilePath, FileMode.Open,    FileAccess.Read);
   if (upprice.FileName.Contains(".xlsx"))
   {
    IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
     DataSet result = excelReader.AsDataSet();
   }
  </code></pre>