使用DataGridView更新多个表 [英] Using DataGridView to Update Multiple Tables

查看:314
本文介绍了使用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:

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

这篇关于使用DataGridView更新多个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆