使用DataGridView更新多个表

编程入门 行业动态 更新时间:2024-10-14 12:26:41
本文介绍了使用DataGridView更新多个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在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.

在数据集中,我有一个Fill命令,它连接三个表,并在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.

任何帮助将不胜感激。

谢谢。

推荐答案

您需要提供自定义更新命令 - 这里有一个演练:

You need to provide custom update commands - there's a walkthrough here:

www.asp/learn/data-access/tutorial-69-vb。 aspx

更多推荐

使用DataGridView更新多个表

本文发布于:2023-10-26 17:37:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1530861.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   DataGridView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!