Skip to content
This repository has been archived by the owner on Jan 25, 2019. It is now read-only.

Bug: LoadFromDataReader throws an invalid row number error #44

Open
chris2131 opened this issue Mar 28, 2018 · 0 comments
Open

Bug: LoadFromDataReader throws an invalid row number error #44

chris2131 opened this issue Mar 28, 2018 · 0 comments

Comments

@chris2131
Copy link

The LoadFromDataReader will throw an invalid row number error if you try to load an empty table without headers. If you load the empty table with headers then the load will process successfully.

The issue is located in ExcelRangeBase.cs, Line number:1839

return _worksheet.Cells[_fromRow, _fromCol, row - 1, _fromCol + fieldCount - 1];

should be changed to

return _worksheet.Cells[_fromRow, _fromCol, (row <= 1 ? 1 : row - 1), _fromCol + fieldCount - 1];

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant