I have c# desktop application with MS-Sql server as back end. This desktop application will be running in two different systems (database will also be in local system), I want the data to be synced between these two systems bidirectionally.
For this I am able to generate JSON file for the differential data, now I want that JSON file to be transferred to the other system. On receiving JSON file, I can update and insert data to the database.
I am using .Net 4.0 and MS Sql 2008.
Please suggest me, how can I pass the JSON file from one system to the other system.
Mohamed Azarudeen ZPosted Jul 12, 2023, 3:13 PM
Hi Mithun
Here are a couple of common approaches:
1. File Transfer: You can use a file transfer mechanism to move the JSON file from one system to another. Some possible methods include:
a. Shared Network Folder: Set up a shared network folder accessible by both systems. The sending system can save the JSON file to this folder, and the receiving system can periodically check for new files and process them.
b. FTP/SFTP: Use FTP (File Transfer Protocol) or SFTP (SSH File Transfer Protocol) to transfer the JSON file securely between the systems. The sending system can upload the file to an FTP/SFTP server, and the receiving system can download it from there.
2. Web API/Service: Implement a web API or service that exposes endpoints for sending and receiving the JSON file. This approach requires setting up a server or service accessible to both systems. The sending system can make an HTTP request to the API endpoint with the JSON file as the payload, and the receiving system can have an endpoint that accepts the file, processes it, and updates the database accordingly.
If you find this answer usefull kindly accpet Thank you.