在网格中保存新行 [英] save new rows in grid

查看:86
本文介绍了在网格中保存新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能仅将网格中的新行插入数据库中,而仅更新现有行.
如何查找哪个是新行,哪些是现有行?

how can i insert only new rows from grid into database and only update the existing rows.
how to find which is new and which are existing rows ?

推荐答案

以为这是Sql Server,而您正在使用数据集,则可以使用SqlDataAdapter [ GetChanges [ ^ ]方法.
Taken this is Sql Server and you''re using a DataSet, you can use SqlDataAdapter[^].

If you need to know the modified, inserted, deleted records from a datatable you can use GetChanges[^] method.


这篇关于在网格中保存新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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