Click here to Skip to main content
15,885,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When running the application in multiuser environment changes made by one user i.e modifying, adding or deleting records are not seen by other user until they restart the application. I think I know why this problem is occuring. During Form_load, data from the table is collected into a Dataset, which is displayed on form using databinding. When user starts the application data containing in the table is only transferred to Dataset ,so the user cant see changes made by other user during runtime.

Please help on this issue.

Thanks in Advance.


UPDATE

somehow I have handled concurrency issue, but still I am stuck on my basic question i.e how to reflect changes to other users. I tried reloading data when clicked on cancel( button on form used to cancel any insert,update in tabel) button, it is working OK but taking some time for data to reload.

What I have tried:

I tried to run the code for fetching data in Dataset on every changes, but it is not still reflecting on other user. And I think the is not a good method because it will be time consuming to load data on every change.
Posted
Updated 22-Dec-19 7:15am
v2
Comments
DerekT-P 30-Nov-19 8:26am    
I'm assuming this is a desktop app rather than browser-based. It would be helpful if you would confirm that. From your question, it sounds like there's one table whose contents are displayed to multiple users simultaneously, and some/all of those users can add / delete / update rows in that table. How are you dealing with cases where a row in the process of being modified by one user is deleted by another? What if two users concurrently make changes to the same row, but different columns? I suspect you may have much bigger problems than how to refresh the screen automatically unless you've addressed these issues. To update the screen(s) on any data update, there are essentially two options: (1) Polling - each client periodically re-checks some d/b indicator to see if anything's been updated, and if it has, refresh the screen; or (2) Push notifications - the process of updating a row pushes out notifications to each client to tell them something has changed. Your choice will depend on various things - just how "immediate" do changes need to be reflected; how often are changes made; is your app the only way that data can be changed; how many clients are there; are all clients on the same network; and probably many other considerations too.
You say you've tried re-fetching the dataset on every change, but your comment suggests you think that refreshing one user's screen will somehow refresh all the others? Regardless, I still suspect you will run into problems if you are just continuously showing a static dataset to all users while allowing any user to update the data at any time.
Go back and think about your users' requirements and how your overall design could fulfil those.
Member 13550326 22-Dec-19 13:14pm    
somehow I have handled concurrency issue, but still I am stuck on my basic question i.e how to reflect changes to other users. I tried reloading data when clicked on cancel( button on form used to cancel any insert,update in tabel) button, it is working OK but taking some time for data to reload.

1 solution

Basically what you are going to need to do is check the source data on a regular basis to see if the data is current or not; and if not reload the table.

There are a few ways to do this and it can be very complicated, I would suggest you do some more research into this
 
Share this answer
 

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