阻止数据网格编辑在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
更多推荐
发布评论