在C#中引用excel数据表 [英] Referencing an excel data table in C#
问题描述
我试图在C#中引用excel数据表但没有太大成功。 我找到了创建新数据表的示例,但我有一个我想要阅读的现有表。
我可以通过row / col循环处理每个单元格,但是,有没有办法通过列名访问列?
ruth
如果您的意思是参考表,请参阅我的代码示例(它具有VB.NET和C#,而C#有一个类但不显示用法以及VB.NET但足以让您前进)。 / p>
https://code.msdn.microsoft。 com /使用Excel-cdd73a85?redir = 0
I'm trying to reference an excel data table in C# without much success. I'm finding examples of creating a new data table, but I have an existing table that I'd like to read.
I can process through each cell via row/col looping however, is there a way to access the column via the column names?
ruth
If you mean reference tables see my code sample (it has VB.NET and C# while the C# has a class but does not show usage as well as the VB.NET but enough to get you going).
https://code.msdn.microsoft.com/Working-with-Excel-cdd73a85?redir=0
这篇关于在C#中引用excel数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!