通过列标题查找Excel数据并更新标题下的数据 [英] Locate Excel data by column header and update the data below the header

查看:221
本文介绍了通过列标题查找Excel数据并更新标题下的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,专家,
有人可以让我知道如何使用C#读取基于C#的特定列吗? 标头?
由于我不知道如何在Excel中插入值,因此我只是在此处绘制"工作表以帮助您理解.

Hi experts,
Can anybody please let me know how I can use C# to read a specific column based on its
header?
As I do not know how to insert value in an Excel, so I simply "drawn" a sheet here to help you understand.

ID    Name   Gender
01    X      M
02    Y      F
03    Z      M


注意:周围的空格"表示周围的空白单元格.

现在假设我要找到ID列,然后在下面更新其数据.任何好主意都会受到欢迎.
希望这不是一个坏问题. :)
问候
Pandvi


Note: The "space" around represents the empty cells around.

Now let''s say I want to locate ID column and then update its data below. Any good idea will be greeted.
Hope it is not a bad question. :)
Regards
Pandvi

推荐答案

请参考类似的讨论 ^ ]
还可以查看 DataColumn.ColumnName属性 [ ^ ]
Please refer similar discussion here[^]
Also have a look on DataColumn.ColumnName Property[^]



在这里通过链接-
一个非常易于使用的Excel XML导入导出库 [ ^ ]
Hi,
Here go through the the link-
A Very Easy to Use Excel XML Import-Export Library[^]


这篇关于通过列标题查找Excel数据并更新标题下的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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