Small Change to ExcelOpenXmlReader

Nov 19, 2010 at 9:12 PM


In the source I have the line in ExcelOpenXmlReader.AsDataSet(bool convertOADateTime) is:

if(table.Rows.Count > 0) dataset.Tables.Add(table);

However this ignores situations in which _isFirstRowAsColumnNames == true but no further rows follow (an XLSX with headers only) and returns a null DataSet.

You might consider changing the line to:

if(table.Rows.Count > 0 || table.Columns.Count > 0) dataset.Tables.Add(table);

Thanks and EXCELLENT work on this!