datagridview自动提交 [英] datagridview autocommit

查看:90
本文介绍了datagridview自动提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在datagridview中禁用自动提交?
在哪里可以找到插入命令?

how to disable the autocommit in the datagridview??
and where can i find the insert command??

推荐答案

您不能禁用此命令.将DGV绑定到数据源后,将对数据源进行所有更改.在这种情况下,是一个数据集.除非您告知更改,否则更改不会提交到支持的数据库.

现在,DataSet/Table类维护一个列表,该列表对对象以及填充Set/Table时的原始值进行了更改.因此,如果要放弃更改,只需在数据集/表上调用RejectChanges.
You can''t disable this. Once you bind a DGV to a datasource, all changes are made to the datasource. In you''re case, a DataSet. Changes are NOT commited to the backing Database until you tell it to.

Now, the DataSet/Table classes maintain a list of changes that were made to the object as well as the original values when the Set/Table was Filled. So, if you want to abandon changes, you just need to call RejectChanges on the DataSet/Table.


这篇关于datagridview自动提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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