帮助理解数据集、数据表和 Excel 文件
我需要编写一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
数据是否不断更新?
如果不是,使用数据库可能会加速并简化事情。
Is the data constantly being updated?
If it is not, using a DB might speed up and simplify things.