Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have table in .mdb file (say TVehicle) where it contains 'ID', 'make', 'model', 'series' columns with around 50-100 records. There is a Winform tool which fetches these data and show the rows in UI. Now one user (say U1) access these records & selects a vehicle (row from grid) and tries to edit the veihcle. Now when another user U2 tries to edit same vehicle, the user must get notification that user U1 is already engaged with the vehicle you selected so please wait until U1 releases. I need some good logic for locking the rows when a specific user edits the row. (I open a new winform dialog when user double clicks the row in grid for edit). Please help me on this.

What I have tried:

I created another table TUser, when U1 edits the row, the data like Vehicle-ID, user-ID will be inserted into TUser table and the vehicle is locked. When user finishes edit & saves the record, the entry in TUser will be deleted.
Posted
Updated 29-May-19 23:40pm
v2

1 solution

There seems to be a RowUpdated event of the DataAdapter object:
Optimistic Concurrency (ADO.NET) | Microsoft Docs[^]
See example here: Handling DataAdapter Events (ADO.NET) | Microsoft Docs[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900