项目的一个数据源
我正在使用向导将表添加到我的项目中以使用它们。项目只有一个数据源是更好的方法吗?目前只有5张桌子。
帖子编辑 这太麻烦了,我感觉自己使用向导的方式是错误的,这为每个表创建了另一个数据集,所以我只考虑为我的小应用程序使用一个数据集。但由于我对 ADO .NET 的经验很少,我希望在这里得到建议。
I'm using wizard to add tables to my project to work with them. Is having just one datasource for project better way? At the moment there is only 5 tables.
POST EDIT
It's so cumbersome and I'm feeling myself going wrong way to use wizard, that makes another one dataset for every table, so I thought about just one dataset for my little application. But as I have little experience with ADO .NET, I hope to get advice here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许最好使用 Entity Framework 4.1 / 4.2< /a>
Perhaps is better to use Entity Framework 4.1 / 4.2
我发现当系统的功能彼此隔离时,维护应用程序会容易得多。因此,在这种情况下,拥有一个数据集(每种系统访问方式都有一个数据集)将使维护变得更加容易。
这是如何实现的一个示例:
对于 5 个表的系统来说,这可能有点过大了,但如果可以的话训练自己在特定上下文中思考,这使得扩展和改变系统变得更加容易。
I find it's much easier to maintain an application when features of the system are isolated from one another. So in this instance having a dataset, one for each way the system is accessed, would make it easier to maintain.
an example of how this plays out:
this is probably overkill for a system of 5 tables, but if you can train yourself to think in context specific usages, it makes it much easier to expand and change the system moving forward.
如果您想使用类型化 DataSet 而不是 EF 或 Linq2Sql,只需将新的 DataSet 添加到您的项目中,打开它,右键单击并添加 -> TableAdapter,添加您需要的所有表。
If you want to use typed DataSet instead of EF or Linq2Sql just add new DataSet to your project, open it, right click and Add->TableAdapter, add all tables you need.