Excel 电子表格的自定义 LINQ 提供程序?

发布于 2024-08-11 08:38:56 字数 47 浏览 3 评论 0原文

有谁知道一个好的自定义 LINQ 提供程序来查询 Excel 电子表格中的数据?

Does anyone know a good custom LINQ provider to query data from Excel spreadsheets?

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

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

发布评论

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

评论(1

海之角 2024-08-18 08:38:56

Linq to Excel 开源项目实现了一个简单直观的 LINQ 提供程序,用于从 Excel 获取数据电子表格。它负责在后台创建 OLEDB 连接和 sql 语句以及填充返回对象属性。

例如,下面的代码从 Excel 中读取数据并返回 User 对象的列表。它会自动将电子表格中的列名称映射到类上的属性名称。

var book = new ExcelQueryFactory(@"C:\Users.xls");
var administrators = from x in book.Worksheet<User>()
                     where x.Role == "Administrator"
                     select x;

查看项目主页,并确保查看介绍视频

The Linq to Excel open source project implements a simple and intuitive LINQ provider for getting data from Excel spreadsheets. It takes care of creating the OLEDB connection and sql statement in the background as well as populating the return object properties.

For example, the code below reads the data from excel and returns a list of User objects. It automatically maps the column names in the spreadsheet to the property names on the class.

var book = new ExcelQueryFactory(@"C:\Users.xls");
var administrators = from x in book.Worksheet<User>()
                     where x.Role == "Administrator"
                     select x;

Checkout the project home page and be sure to view the introductory video.

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