简体   繁体   中英

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM