Updater for multi-user program
-
Hi I have created a program that is intended to be used by multiple users (each on their own computer) who access the same SQL database. I have also created a separate updater program to sit alongside the main application. However, I am unsure how to check if there are any users in the main program before the update is run. (This is easy to do on a single user application but not sure on multi-user). Any help is greatly appreciated (I am relatively green here so please be kind)
-
Hi I have created a program that is intended to be used by multiple users (each on their own computer) who access the same SQL database. I have also created a separate updater program to sit alongside the main application. However, I am unsure how to check if there are any users in the main program before the update is run. (This is easy to do on a single user application but not sure on multi-user). Any help is greatly appreciated (I am relatively green here so please be kind)
If you want to update only client application, the number of users connected to the database is not important. Does updater have to update database too?
-
If you want to update only client application, the number of users connected to the database is not important. Does updater have to update database too?
No. The client will be updating the database. It is more an issue of ensuring no users are in the program while the update is running. If this was a single user prograM then it is easy to check and force a close. I am not sure when there is more than one user (from different computers)
-
No. The client will be updating the database. It is more an issue of ensuring no users are in the program while the update is running. If this was a single user prograM then it is easy to check and force a close. I am not sure when there is more than one user (from different computers)
Sorry, but you wrote that every client application is opened on client machine. You don't have to care about other clients. So, if a single instance of client application is running on client machine, you can close it via updater. You don't even need to write custom updater. See: [How to: Specify the Location Where End Users Will Install From - Visual Studio | Microsoft Docs](https://docs.microsoft.com/en-us/visualstudio/deployment/how-to-specify-the-location-where-end-users-will-install-from?view=vs-2019) Here is interesting alternative: [Simple Auto-Update: Let your application update itself using 2 lines of code](https://www.codeproject.com/Articles/731954/Simple-Auto-Update-Let-your-application-update-i)
-
Hi I have created a program that is intended to be used by multiple users (each on their own computer) who access the same SQL database. I have also created a separate updater program to sit alongside the main application. However, I am unsure how to check if there are any users in the main program before the update is run. (This is easy to do on a single user application but not sure on multi-user). Any help is greatly appreciated (I am relatively green here so please be kind)
I think what you need to research is the topic of concurrency. One way to implement this is to have a Modify Date on the primary record. 1) Read the table entry along with the modify date/time. 2) When updating the database, compare the original date/time with the value currently stored, if the date/time has not been changed, then it is OK to perform your update. (Rollback) During your update you would set the modify date/time to the current date/time. (GetDate() ) Something like that.