简体   繁体   English

如何在查询C#的Excel工作表中选择一组行和列?

[英]How can I select a set of rows and columns from an excel sheet in query for C#?

I want to select the following data from excel: 我想从excel中选择以下数据:

Rows : 3-7 Columns : CW 行:3-7列:CW

How can I write a query to do this. 我该如何写一个查询来做到这一点。

Thanks in advance. 提前致谢。

If I understood correctly, you are asking to get data from excel. 如果我理解正确,则您要求从excel获取数据。 Simple way would be (if not simplest) Load your Excel File sheets in DataSet's DataTable and then read the DataTable accordingly. 简单的方法是(如果不是最简单的话)将Excel文件表加载到DataSet的DataTable中,然后相应地读取DataTable。 Row index 0-6 and Column Index 2-22 行索引0-6和列索引2-22

here's how to load Excel in Dataset 这是在数据集中加载Excel的方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM