在 VB.NET 2008 表单上,我有一个 DataGridView、BindingSource 和 TableAdapter.
On a VB.NET 2008 form I have a DataGridView, BindingSource and TableAdapter.
BindingSource DataSource 是一个数据集.
The BindingSource DataSource is a dataset.
在数据集中,我有一个连接三个表的填充命令,它在 DataGridView 中显示没有问题.
In the dataset I have a Fill command that joins three tables and this is displayed without a problem in the DataGridView.
但是,我无法更新 dataGridView,因为它有来自单个 TableAdapter 的多个表?
However, I am unable to Update the dataGridView because it has multiple tables from a single TableAdapter?
有谁知道我可以更新的简单方法.这些表有 200 多列,我只想更新已更改的列.如果我使用单个表,我可以在 DataGridView 中编辑数据并且数据库更新正常.
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.
任何帮助将不胜感激?
谢谢.
推荐答案不幸的是,Windows.Forms BindingSource 不支持复杂的属性(我假设你在使用它).
Unfortunately, the Windows.Forms BindingSource, does not support complex properties (which I assume you are after).
您必须制作自己的自定义 BindingSource(可能会为您定制)来处理复杂的属性值和分配.
You would have to craft your own custom BindingSource (and it will likely be bespoke to you) to handle complex property values and assignments.
更多推荐
使用 DataGridView 更新多个表
发布评论