J
John Sparrow
Has anyone got code for checking if the database row being viewed has
changed since it was delivered to the browser? ie before the UPDATE is
run? I'd imagine it would work something like this:
First page request (doing the select):
======================================
select row from table
store row in session
bind controls to row values (dataset or whatever)
end
Wait for user to do edit, and press submit.
Page postback:
==============
begin transaction
select same row from database again
compare with row held in session
if they match, apply changes from user postback
if they don't, inform user underlying data has changed, and request
confirmation (showing 'befores' and 'afters')
commit
end
changed since it was delivered to the browser? ie before the UPDATE is
run? I'd imagine it would work something like this:
First page request (doing the select):
======================================
select row from table
store row in session
bind controls to row values (dataset or whatever)
end
Wait for user to do edit, and press submit.
Page postback:
==============
begin transaction
select same row from database again
compare with row held in session
if they match, apply changes from user postback
if they don't, inform user underlying data has changed, and request
confirmation (showing 'befores' and 'afters')
commit
end