LadyReader
New member
- Joined
- Mar 28, 2006
- Messages
- 2
- Programming Experience
- 10+
I have a VB.net windows app that's been in production a few years. There's a main page with a datagrid showing rows of items. The user can click on an row to display another page with the selected item's detail.
Recently 2 users displayed the same row concurrently; the first user clicked on a button to email the item detail to a 3rd party outside the company while the other user was still making changes to the detail.
To prevent this kind of contention, I thought of adding a field to the SQL backend where I would store the name if the user who retrieves that record. If the field is populated than I would disallow any other user from updating the record or emailing it. I would also display the name of the first user if a subsequent user tried to see that record (forcing a read-only status). The SQL field would be reset to NULL when the first user closes the detail window.
Is there a better way?
Thank you.
Recently 2 users displayed the same row concurrently; the first user clicked on a button to email the item detail to a 3rd party outside the company while the other user was still making changes to the detail.
To prevent this kind of contention, I thought of adding a field to the SQL backend where I would store the name if the user who retrieves that record. If the field is populated than I would disallow any other user from updating the record or emailing it. I would also display the name of the first user if a subsequent user tried to see that record (forcing a read-only status). The SQL field would be reset to NULL when the first user closes the detail window.
Is there a better way?
Thank you.