Search code examples
c#asp.netdatabasedatagridrecords

Prevent datagrid edit from updating more than one record at a time in 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?


Solution

  • 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