开发者

Read the Data from Excel sheet into datatable without empty rows in C#

开发者 https://www.devze.com 2022-12-10 12:50 出处:网络
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开发者_运维技巧 m

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消