使用 DataGridView 更新多个表
在 VB.NET 2008 表单上,我有一个 DataGridView、BindingSource 和 TableAdapter。
BindingSource 数据源是一个数据集。
在数据集中,我有一个连接三个表的 Fill 命令,并且在 DataGridView 中显示时没有问题。
但是,我无法更新 dataGridView,因为它具有来自单个 TableAdapter 的多个表?
有谁知道我可以更新的简单方法。这些表有 200 多个列,我只想更新已更改的列。如果我使用单个表,我可以在 DataGridView 中编辑数据并且数据库更新正常。
有任何帮助吗?
谢谢。
On a VB.NET 2008 form I have a DataGridView, BindingSource and TableAdapter.
The BindingSource DataSource is a dataset.
In the dataset I have a Fill command that joins three tables and this is displayed without a problem in the DataGridView.
However, I am unable to Update the dataGridView because it has multiple tables from a single TableAdapter?
Does anyone know a simple way I can update. The tables has over 200 columns and I only want to update the columns that are changed. If I use a single table I can edit data in the DataGridView and the database is updated ok.
Any help would be appreciated?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,
Windows.Forms BindingSource
不支持复杂的属性(我假设您正在追求复杂的属性)。您必须制作自己的自定义
BindingSource
(它可能是为您定制的)来处理复杂的属性值和分配。Unfortunately, the
Windows.Forms BindingSource
, does not support complex properties (which I assume you are after).You would have to craft your own custom
BindingSource
(and it will likely be bespoke to you) to handle complex property values and assignments.