我怎样才能在OLEDB Excel文件躲闪空行? [英] How can I dodge empty rows in an Excel file with OleDB?
本文介绍了我怎样才能在OLEDB Excel文件躲闪空行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我开始使用OLEDB。我试图从Excel文件了大范围的随机数据(在C#)。这是我的查询:
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 ?
最好的问候,
亚历
推荐答案
只需更改SQL查询:
SELECT * FROM NAMED_RANGE WHERE [YourColumnTitle] IS NOT NULL
或者如果[F1]是你列:
Or if [F1] is your Column:
SELECT * FROM NAMED_RANGE WHERE F1 IS NOT NULL
由于mr.Reband
Thanks to mr.Reband
这篇关于我怎样才能在OLEDB Excel文件躲闪空行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文