another Concurrency problem

L

L.Peter

Hi Group,
Hope you can help me with this problem:
I have a gridview with sqldatasource bound to it.
updatestatement will call stored procedure. the table that being updated
called table1 has id, fld1,fld2, lastwritedatetime.
the selectstatement is select * from table1
The update stored procedure is very simple: update table1 set fld1=
@fld1,fld2=fld2 where id=@id.
before calling gridview_rowupdating, I'd like to check whether the record
was modified by someonelse. I am thinking of calling simple select
statement: select id from table1 where id= @id and lastwritedatetime =
@lastwritedatetime
Questions: How can I know which row the user is editing from gridview or
from sqldatasource, in the grid view, I did not include coulmns id and
lastwritedatetime as these columns are not relevant to users.

TIA
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top