This is a migrated thread and some comments may be shown as answers.

Synchronising offline and multiple users with SQL server DataSet

1 Answer 194 Views
DataEntry
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
Iron
James asked on 19 Feb 2021, 10:37 AM

Hi,

I have a situation where I am struggling with data synchronisation. Using the merging functionality of a dataset with DataTables, my app is able to run in offline mode and synch back to the SQL server database using the AcceptChanges and Merge operations. When calling the merge operation, you can PersistChanges. When you do that, what is in the offline datasets overrides the database. When you do not persist changes, what is in the database overrides the local inline changes.

Now, this is fine for a single user but what if the application (a time management console in my case) was installed on multiple servers and the database is updated by multiple instances of the application?

I know Microsoft Synchronisation services used to handle this, but now I am stuck. I could get column changes and populate a temporary table with changes processed by a job or windows service. However, is there an easier way?

FYI, I use a Telerik radGrid to display activity data with numerous other tables that run in memory such as client/project/content data. However, the main data I am trying to sync is the activities.

Has anyone been able to achieve something similar by using datasets and the DataTable merge operation? I would love to hear from you.

Cheers, James

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Feb 2021, 12:08 PM
Hello, James, 

Your inquiry seems to be more like a general programming question for managing the database and saving the changes when the database is updated by multiple instances of the application. RadGridView is just the UI control that visualizes the data, allows editing this data and then, you can save the changes back to the database. You can find below two approaches for saving the changed made in RadGridView back to the database:

https://docs.telerik.com/devtools/winforms/controls/gridview/populating-with-data/updating-the-database-with-ado.net 
https://docs.telerik.com/devtools/winforms/controls/gridview/populating-with-data/binding-to-entityframework-using-database-first-approach 
 
I have made some research in general programming forums for recommendations how to properly synchronize the database and RadGridView in your application while multiple instances of the application may be running simultaneously. I believe that you will find the following threads useful:

https://social.msdn.microsoft.com/Forums/en-US/9b195fff-4611-43a3-9a65-f651e6a497ef/winform-application-with-multiple-users-with-sql-server-2008-r2-express-database?forum=winformsdatacontrols 

https://stackoverflow.com/questions/31112844/how-to-implement-a-c-sharp-winforms-database-application-with-synchronisation 

I hope this information helps. If you need any further assistance please don't hesitate to contact me.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DataEntry
Asked by
James
Top achievements
Rank 1
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or