用于处理 Excel 数据的接受集合
我有一堆数据正在提取到我的应用程序中,坦率地说,最好将其表示为 Excel 电子表格。我的意思是:
- 有很多列需要“总结”
- 有合理数量的数据(基本上是一张数字)
目前这只是数据库中的原始数据,但我还有一个电子表格显示此数据(以及我需要在应用程序中复制的公式)。
目前,我刚刚获得了每行的 List
,但是我相信可能有更好的集合来存储这种类型的数据。我基本上需要能够轻松地操纵这些数字。
有什么建议吗?
I have a bunch of data that I'm pulling into my application which frankly is best represented as an Excel spreadsheet. By this I mean:
- There are a lot of columns which need 'summing up'
- There is a reasonable amount of data (basically a sheet of numbers)
At the moment this is just raw data in a database, but I also have a spreadsheet which shows this data (along with formulas that I need to replicate in my app).
At the moment I've just got a List<of T>
of each row, however I believe there might be a better collection for storing data of this type. I basically need to be able to manipulate these numbers easily.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种选择是使用 DataTable 它也有内置聚合方法。
例如(来自 MSDN):
另一个优点是它支持使用 LINQ-To 进行 LINQ 查询-数据集。
One option would be to use a DataTable which also has a builtin aggregation method.
For example(from MSDN):
Another advantage is that it supports LINQ queries with LINQ-To-DataSet.
如果您的“excel 数据”可以用模型表示,我只会使用模型。例如,如下所示:
然后您可以轻松创建一个
List
,并获取总数,如下所示:If your "excel data" can be represented in models, I'd just use models. For example like so:
Then you can easily create a
List<ExcelModel>
, and get the total like so: