I am getting error "Object reference not set to an instance of an object" while try to read attached file.
Everything works fine after I open in excel and save. Just in case, I am getting this file in email attachment.
FileStream stream = File.Open(@"C:\1.xls", FileMode.Open, FileAccess.Read);
IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
excelReader.IsFirstRowAsColumnNames = true;
DataSet result = excelReader.AsDataSet();
excelReader.Close();
Everything works fine after I open in excel and save. Just in case, I am getting this file in email attachment.
FileStream stream = File.Open(@"C:\1.xls", FileMode.Open, FileAccess.Read);
IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
excelReader.IsFirstRowAsColumnNames = true;
DataSet result = excelReader.AsDataSet();
excelReader.Close();