How can I dodge empty rows in an Excel file with OleDB?

梦想的初衷 提交于 2019-12-19 09:19:30

问题


I start to use OleDB. I'm trying to extract a large range of random data from an Excel file (in C#). This my query :

SELECT * FROM NAMED_RANGE

But I have a lot of empty rows. I delete them in a loop but I don't really like it, is it possible to select only rows with at least one cell filled ?

Best regards,

Alex


回答1:


Simply change the SQL Query:

SELECT * FROM NAMED_RANGE WHERE [YourColumnTitle] IS NOT NULL

Or if [F1] is your Column:

SELECT * FROM NAMED_RANGE WHERE F1 IS NOT NULL

Thanks to mr.Reband



来源:https://stackoverflow.com/questions/17149948/how-can-i-dodge-empty-rows-in-an-excel-file-with-oledb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!