Read the Data from Excel sheet into datatable without empty rows in C#
I have a problem for reading data from Excel sheet using connection string. I am getting data. But problem is blank rows also coming. I don't want to get blank row. Can any body help开发者_运维技巧 me.
Thanks in Advance. Mehar
If there are blank rows in your sheet, you will get blank rows when you read the Excel sheet. Either remove the blank rows from your sheet or add logic to detect and ignore blank rows.
If it's extra rows after the data you want, you will get them if there is formatting on the cells. Select the extra range, right click and do Clear Contents.
精彩评论