简体   繁体   English

数据库主从关系和数据网格视图

[英]Database Master detail relation and datagridview

I looking simplest way to implement master detail winforms app (using mainly data grid view) It should interact with database, handling database exceptions (eg unique index violation) and work in multi user environment (concurrent updates etc)我正在寻找实现 master detail winforms 应用程序的最简单方法(主要使用数据网格视图)它应该与数据库交互,处理数据库异常(例如唯一索引冲突)并在多用户环境中工作(并发更新等)

I know how to do that with data set and relation between tables, not sure what is best approach if this has to work with database Few years ago I did similar app base on business objects and stored procedures but I believe this can be done easier this days.我知道如何使用数据集和表之间的关系来做到这一点,如果这必须与数据库一起使用,我不确定什么是最好的方法几年前我做了类似的基于业务对象和存储过程的应用程序,但我相信这可以更容易地做到这一点天。

Appreciate if someone can share general ideas or share some links to webpages discribing that in detail感谢有人可以分享一般想法或分享一些详细描述这些想法的网页链接

A DataSet combined with a BindingSource could be, what you are looking for.BindingSource结合的DataSet可能是您正在寻找的。 For a simple master/detail view it provides everything you need.对于简单的主/细节视图,它提供了您需要的一切。

  • Connection management.连接管理。
  • Certain degree of error handling.一定程度的错误处理。
  • Binding every kind of control to your data将各种控件绑定到您的数据
  • In simple cases, like yours, almost everything can be done in Visual Studio GUI在像您这样的简单情况下,几乎所有事情都可以在 Visual Studio GUI 中完成
  • Data-navigation controls数据导航控件

BindingSource 绑定源

BindingNavigator 绑定导航器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM