Oledb data reader reading deleted rows in excel document

I am using OLEDB Connection to read excel document, this document has data up to 100 rows. but when i delete 5 lines try again to read the document that reads OLEDB up to 100 lines instead of 95. Then throws an exception. I am wondering why it reads up to 100 lines, because there are only 95 lines.

+3


source to share


1 answer


In many cases Excel will "remember" that these 5 rows contained data, so they are included in the query results. (This assumes you just deleted the contents of the lines). A simple fix for this is to remove the entire row, not just the row content from the Excel spreadsheet; then save and close the table. In the cases I've tested, this removes these "blank" lines from the query results.



+3


source







All Articles