raajanis

raajanis

  • NA
  • 2
  • 0

ado.net concurrency issues

Aug 3 2005 7:42 AM
I am working with C#, ASP.NET & SQL 2K for a little over 2 years now. All this time i have been wondering how can we handle the concurrency issue using ADO.NET. Till now what I have been doin is that i would open a column lets say 'is_selected' in the table. At the time of selecting a record, i would insert the user name (ip/computer name in few cases) in that column. If anyone would try to update the rows which dont have 'is_selected' not null, it would prompt the users with some message. I would set 'is_selected' column back to null when the record is released either when user cancelled or finished editing. But this is a very dirty way of handling concurrency, involving alot of code and work that is simply an overhead. There must be a better way to handle this issue. I know i can do it at database end but how can i have the row(s) b/w the time of selection and saving a record? b/w the time of selection and saving a record starts from the point when you execute a select query and select row(s) and show it to the GUI and ends at the piont when user makes the changes and hits save.