Excel读取仅行和包含文本的列 [英] Excel reading onlyrows and columns that contains text

查看:126
本文介绍了Excel读取仅行和包含文本的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在从我的C#代码访问Excel工作表.
我将所有行存储在DataSet中.

但是我有一个问题.
在数据集中获取完整的Excel内容后,我也得到了一些空行.
是否有任何捷径可以删除DataSet中的空行?
我可以使用循环,也可以转储到其他Dataset中,但除此之外可以使用其他任何方法.

我正在使用Ms-Sql

[edit]删除了虚假的代码块,并拼写了一些大写字母-OriginalGriff [/edit]

解决方案

稍等片刻:您的名字叫Alim Basha,而您发布的正是在2007年的MSDN上也有同样的问题.
http://social.msdn.microsoft.com/Forums/zh/adodotnetdataproviders/thread/0385aa4a-1db2-41e6-8431-f0a2835ae317 [
这是怎么回事?

顺便说一句:更改用户名:永远不要在公共论坛上发布您的电子邮件.


从excel中选择数据时,通过选择查询(条件为columnname<> string.Empty)来删除空行. blockquote>

Hi Guys,

I am accessing Excel sheet from my C# Code.
I am storing all rows in DataSet.

But I have a problem.
After getting entire Excel contents in DataSet I am getting some empty rows also.
Is there any short cut to remove that empty rows in DataSet?
I can use loop or I can dump into other Dataset but other than this any method.

I''m using Ms-Sql

[edit]Spurious code block removed, spelling and some capitalisation - OriginalGriff[/edit]

解决方案

Hang on a moment: Your name is Alim Basha and you posted exactly the same question on MSDN in 2007.
http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/0385aa4a-1db2-41e6-8431-f0a2835ae317[^]

And when I say "exactly the same question" I mean just that: capitalisation errors, spelling error, exact wording and format, the lot.

What is going on here?

BTW: change your username: never post your email to a public forum.


while selecting data from excel remove empty rows by select query giving condition like columnname <>string.Empty


这篇关于Excel读取仅行和包含文本的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆