在DataGridView上进行更改后,如何更新DataTable? [英] How to update DataTable when changes on DataGridView were made?

查看:77
本文介绍了在DataGridView上进行更改后,如何更新DataTable?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!我有一个关于在更新对象DataTable之后的问题 在DataGridView上进行了更改.我认为这不是一个好主意 一个接一个的单元...问题是我可能无法使用DataAdapter,因为 我下面没有任何数据库.我想存储更改的数据 仅在DataTable对象中.
有什么主意吗?
谢谢,
Ziga

Hello! I have a question about updating object DataTable after the changes on DataGridView were made. I think it is not good idea to go cell by cell... The problem is I probably can't use DataAdapter because I don't have any database below. I would like to store changed data only in DataTable object.
Any idea?
Thanx,
Ziga

推荐答案

最好的情况是将数据添加到datatable,然后将dataTable对象分配给dataGridView.DataSource属性.这样,dataGridView中的任何更改将自动反映到Datatable对象中的数据

希望这会有所帮助
the best case is to add data to datatable and then to assign dataTable object to dataGridView.DataSource property. In this way any changes in dataGridView will automatically reflect to data in Datatable object

Hope this helps


这篇关于在DataGridView上进行更改后,如何更新DataTable?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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