从GridView仅更新更改的值 [英] Update only Changed Values from GridView
本文介绍了从GridView仅更新更改的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
在加载表单时,我正在从数据库中检索值并在datagridview中显示.当我单击保存"时,所有值都将被更新.它工作正常.但是我有很多行,因此性能很慢.
这是我正在使用的代码,并且工作正常.
Hello Everybody,
While loading the form i am retrieving values from database and showing in datagridview . when i click save,all the values are being updated .It is working fine.But i have many rows so performance is slow.
This is code i am using and it is working fine.
foreach (DataGridViewRow examinationlistrow in dgvExamination.Rows)
{
string _examinid = examinationlistrow.Cells[0].Value.ToString();
string _examinvalue = examinationlistrow.Cells[3].Value.ToString();
UpdateListItem(mrid, ic, _examinid, _examinvalue);
}
但是我只想更新datagridview的更改值.
But i want to update only changed values of the datagridview.
推荐答案
与ListView类似的示例.
http://simpledotnetsolutions.wordpress.com /2011/10/22/listview-bulk-edit-using-ado-nets-batchupdate-and-jquery/ [
A similar example with ListView.
http://simpledotnetsolutions.wordpress.com/2011/10/22/listview-bulk-edit-using-ado-nets-batchupdate-and-jquery/[^]
Hope this helps.
这篇关于从GridView仅更新更改的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文