本文介绍了仅查找Excel工作表列名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想使用c Sharp提取/检索EXCEL工作表的列名.例如,excel工作表具有以下结构的数据:-

I would like to extract / retrieve only the COLUMN NAMES OF AN EXCEL sheet using c sharp. For example an excel sheet has data in following structure:-

TITLE   | FIRST NAME | LAST NAME
-----------------------------------
Ms.     | Jeannette  | Higgi
Mr.     | Ian        | Botham
Mr.     | Lawrence   | Bocha

Sheet1 (sheet name)


输出应为:-


The output should be:-

TITLE
FIRST NAME
LAST NAME



非常感谢您的宝贵建议.

提前谢谢.

Mohandas.



Your valuable suggestion is highly appreciated.

Thanks in advance.

Mohandas.

推荐答案

dt.Columns[0].ColumnName



确保列名应该是excel的第一行.



Be sure Column name Should be first row of excel.




这篇关于仅查找Excel工作表列名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 21:52
查看更多