FileStream stream = File.Open(strTempPath, FileMode.Open, FileAccess.Read); if (Path.GetExtension(strTempPath).Equals(".xls")) // Reading from a binary Excel file ('97-2003 format; *.xls) excelReader = ExcelReaderFactory.CreateBinaryReader(stream); else //Reading from a OpenXml Excel file (2007 format; *.xlsx) excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream); excelReader.IsFirstRowAsColumnNames = true; DataTable result = new DataTable(); result = excelReader.AsDataSet(true).Tables[0];
DateTime.FromOADate(double d)
try { double d = double.Parse(b); // Get the converted date from the OLE automation date. DateTime conv = DateTime.FromOADate(d); } catch{}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)