Gridview rowupdating oldvalues empty

12 Nov

I've seen a number of "answers" which only provide the text in the selected row of a gridview, or the header text which both do not answer the question that was asked... If you were going to do audits of updates in a system and wanted to compare old values and new values and only update if they change and want to indicate which field was updated how do you show the database table field name at the index of the loop.

gridview rowupdating oldvalues empty-60gridview rowupdating oldvalues empty-40gridview rowupdating oldvalues empty-56gridview rowupdating oldvalues empty-83

I just selected the Auto Generated Edit Button and Auto Generated Delete Button properties to True in the properties tab for the grid. Took 15 minutes to change it, my code is half if not less than it was before, and all I worked hard for now just works straight forward.

As for the update query, it's not specified yet, because I can't find the data that has been changed so I can run an update query.

I've found sever 'For Each' examples online to iterate through the 'New Values' and 'Old Values' collections, but it skips right over the loops, so the collections are empty.

I too have been searching for this and all the "answers" that I've seen are not the answers I think some of us are really looking for.

All the mentioned methods I've seen here are not bullet proof references to a database tables field name.