帮助理解数据集、数据表和 Excel 文件

发布于 2024-10-07 07:35:40 字数 318 浏览 0 评论 0原文

我需要编写一个 C# 程序,用于搜索和匹配几个不同 Excel 文档中的特定数据,每个文档可能约有 30 页长。我发现有多种方法可以从我的程序中访问 Excel 数据。例如,我可以创建 excelapp 的实例,打开每个工作簿并使用 COM Excel 对象库中的 Excel 类方法访问信息。我读到这种技术更慢、更笨重。另一种方法是打开与 Excel 文件的 OLE 连接,然后将数据导入数据表或数据集。我相信无论采用哪种技术,我都可以使用 LINQ 表达式从文档中获取和查找我想要的内容。那么您认为什么技术是最好的。如果我将数据导入数据表/数据集,会消耗大量系统内存吗?这是不好的做法吗?我想这就是数据表的用途吧!?!

I need to write a C# program that will search and match specific data in several different excel documents, each of which will likely be about 30 pages long. I have seen that there are several ways to access excel data from within my program. For example I could create an instance of an excelapp, open each workbook and access the info using the Excel classes methods from the COM Excel Object Library. I have read that this technique is slower and more clunky. The other way is to open an OLE connection to the excel file and then bring the data into a datatable or dataset. I believe with either technique I can use LINQ expressions to get and find what I want out of the documents. So what technique do you think is the best. If I import the data into a datatable/dataset would that consume a lot of system memory? Is that bad practice? I guess that's what datatables are for right!?!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一花一树开 2024-10-14 07:35:40

数据是否不断更新?

如果不是,使用数据库可能会加速并简化事情。

Is the data constantly being updated?

If it is not, using a DB might speed up and simplify things.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文