阻止数据网格编辑在ASP.NET中一次更新多个记录(Prevent datagrid edit from updating more than one record at a time in ASP.

编程入门 行业动态 更新时间:2024-10-28 12:31:26
阻止数据网格编辑在ASP.NET中一次更新多个记录(Prevent datagrid edit from updating more than one record at a time in ASP.NET)

我有一个ASP.NET数据网格,但问题是我去编辑一个记录的列,它最终更新数据库显示的所有记录,我更新的任何列(甚至是未选择的列)。 有没有办法防止这种情况发生?

I have an ASP.NET datagrid but the issue is that I go to edit a column for one record and it ends up updating all records shown from the database for any column that I update (even the ones not selected). Is there a way to prevent this from happening?

最满意答案

要解决这个问题,我还必须从返回的记录中返回主键唯一ID,然后说只更新WHERE id = @ID

To fix this, I had to also return the Primary Key unique ID from the returned records and then say to only update WHERE id = @ID

更多推荐

本文发布于:2023-07-06 20:18:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1054509.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   网格   编辑   数据   updating

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!