Datagridview edited by Multiple users
-
Hello, I am developing with VS2005 (VB) I wrote a program that is used by mulitple users at the same time. It contains a datagridview and when a user is editing a spcific record I would like that the data will be refreshed autoatically in all the users screen. I don't want to use timer or flags for refreshing the data but a property like "resync" for example that exists in ADODB.recordset Is ther e any solution Please help Thank you
Shay Noy
-
Hello, I am developing with VS2005 (VB) I wrote a program that is used by mulitple users at the same time. It contains a datagridview and when a user is editing a spcific record I would like that the data will be refreshed autoatically in all the users screen. I don't want to use timer or flags for refreshing the data but a property like "resync" for example that exists in ADODB.recordset Is ther e any solution Please help Thank you
Shay Noy
If you are using SQL Server 2005/2008 take a look at Notification service , but be warned if you have a lot of users there is a substantial overhead.
Bob Ashfield Consultants Ltd
-
Hello, I am developing with VS2005 (VB) I wrote a program that is used by mulitple users at the same time. It contains a datagridview and when a user is editing a spcific record I would like that the data will be refreshed autoatically in all the users screen. I don't want to use timer or flags for refreshing the data but a property like "resync" for example that exists in ADODB.recordset Is ther e any solution Please help Thank you
Shay Noy
this is a typical nightmare some developers get into sooner or later. There is no elegant solution to this. Notification services will do the job but the overhead in both system and support is horrible. Some solutions: Timer as you have surmised it the standard solution. Do not allow inline editing - force the user to a dialog for CRUD and reload the grid when they return (I use this) Test the record BEFORE allowing inline editing and warn the user. Reload the grid when the record is saved.
Never underestimate the power of human stupidity RAH
-
this is a typical nightmare some developers get into sooner or later. There is no elegant solution to this. Notification services will do the job but the overhead in both system and support is horrible. Some solutions: Timer as you have surmised it the standard solution. Do not allow inline editing - force the user to a dialog for CRUD and reload the grid when they return (I use this) Test the record BEFORE allowing inline editing and warn the user. Reload the grid when the record is saved.
Never underestimate the power of human stupidity RAH
Thank you for your reply, If multiple users open dialog for updating the same record, is there a way to lock the record when the first of them is starting the update?
Shay Noy
-
Thank you for your reply, If multiple users open dialog for updating the same record, is there a way to lock the record when the first of them is starting the update?
Shay Noy
Of course but you are not going to like it. Be VERY sure this is a real world issue and not some BA's fantasy. Most developers percieve this as an issue early in their careers and find out it almost never actually happens. I usually don't display ALL the information for a record in the grid so when the dialog goes to get the data to fill all the details it gets/sets as locked flag. If the record returned is locked then don't display the save button. There are HUGE arguments on the best way to implement this, issues such as invalid flags, how to flag time/user/both, how to clear flags. Having said that I have NEVER had to implement this type (or any) of record locking scheme. It has always been an architect who proposes it then the business looks at the likelyhood of data corruption and the cost and hassle of implementing it and chucks it out.
Never underestimate the power of human stupidity RAH