WinForms 中的 BindingSource 控件 - 与 LINQ、ADO.Net 等相比?

发布于 2024-08-03 10:44:59 字数 504 浏览 10 评论 0原文

我对 WinForms 中的数据库编程相当陌生,一直在使用 BindingSource、DataSet 和 TableAdapter 控件在网格和 Component One Chart 控件中显示来自 Access 数据库的数据。

该应用程序现在相当简单 - 用户在网格中选择一行,然后在图表控件中绘制一组相关的数据点。

BindingSource 方法一开始提供了很多即时的满足感,但我现在正尝试使其也与 Component One Report 控件一起使用,并且开始出现一些运行时错误,这些错误在我当前的知识水平下没有意义。

我开始怀疑是否值得继续走这条路,或者我是否应该从一开始就将精力投入到更强大的方法上(例如,LINQ 看起来非常有前途)。

我的问题 - 与 LINQ 相比,BindingSource 方法有哪些限制?

ADO.Net 相比如何?

-Tom Bushell

PS 如果您阅读了这个问题,请投票,这样我至少可以获得足够的代表点来开始评论。谢谢!

I'm fairly new to database programming in WinForms, and have been using BindingSource, DataSet, and TableAdapter controls to display data from an Access database in grid and Component One Chart controls.

The app is fairly simple right now - the user selects a row in the grid, and a related set of data points is plotted in the Chart control.

TThe BindingSource approach provided much instant gratification at first, but I'm now trying to make it work with Component One Report controls as well, and have started getting some run time errors that don't make sense at my current level of knowledge.

I'm starting to wonder if it's worth continuing on this path, or whether I should put my effort into a more powerful approach right from the beginning (LINQ looks very promising, for example).

My question - what are the limitations of the BindingSource approach compared to LINQ?

And how does ADO.Net compare?

-Tom Bushell

PS If you read this question, please vote it up so I can at least get enough rep points to start commenting. Thanks!

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

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

发布评论

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

评论(1

像极了他 2024-08-10 10:44:59

遗憾的是,MS Access 不支持 Linq to SQL。至于 ADO.NET,您已经在使用它了(DataSet 是 ADO.NET 的一部分)。如果您指的是 ADO.NET 实体框架,那么您又不走运了,因为它也不支持 MS Access。

如果您切换到 SQL Compact Edition,您将能够使用其他技术(例如 Linq to SQL),但您仍然会发现 BindingSource 或 BindingList 是将数据绑定到 winforms 的最佳方式,而无需实现您自己的版本。

Unfortunately Linq to SQL is not supported with MS Access. As for ADO.NET, well you are already using it (DataSet is part of ADO.NET). If you meant ADO.NET Entity Framework, you are again out of luck as it also does not support MS Access.

If you switch to SQL Compact Edition you will be able to use other technologies (like Linq to SQL) but you will still find that a BindingSource or BindingList is the best way to get data bound to your winforms without implementing your own version.

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