SQL Data synchronization - c#

We have multiple client operating the same software application which has same database structure on their individual PCs. All the clients are offline and at different locations (Not connected by LAN etc.)
Is it possible that, each client pc collects its own data and then server can restore client's back up and get updated with each of the clients data. By updating/restoring the data on server should be merged with all the client's data, so that server admin can view activity at each client side.
I hope I am clear.
Thank you very much in advance.
Regards.
Edit: We will be using SQL Server Express 2008 Edition.

As #Dennis mentioned you could use Microsoft Sync Framework.
Synchronization is a non-trivial task because of many factors like conflict handling, change detection, timestamp synchronization.... The Microsoft Sync Framework does that all for you.
There are several other Frameworks that do synchonization. See OpenSync or SymmetricDS.

Related

SYNCH databases customization

Existing Application:
I have an existing distributed Windows Forms application which is developed using VS 2013 & SQL Server 2008. Application is communicating through web api's from various remote locations to the central database.
Requirement/Feature:
1. I have to add new feature that application may be run in offline mode if there is no internet connectivity. When application is connected to the internet it should SYNCH all the data automatically to the server. Also if there are any changes to the database server in central database it should be SYNCH to remote locations as well.
The synch mechanism must use the webapis to synch the data and database structure.
My Proposal:
I'm planning to use Microsoft SYNCH framework to add SYNCH feature but it can not be done through webapi's (It has to be done through API's as per client requirement).
Also we need complete audit/reporting of the SYNCH process and hence this can not be done without customizing the program for adding SYNCH feature and we can not use Micorsoft SYNCH framework.
My Question/Queries
Can anyone suggest the best approach to do this so that both data and architecture can be SYNCH?
Would be great if anyone has used the generic approach which may be used for all database tables?
Thank you very much in advance!!

How to send receive data via dialup by Atapi.dll?

I have a c# project that retrieves data from sql server database and stores in it , and I have a copies of this software every one works in different place (different area ) each software stores in its own database. I have to sync the data among these databases by phone line . I have recently read about atapi.dll . Could I use this dll to make synchronization among databases by send receive data between softwares.
for ex: in the first place i have to send the new records to the other place
the first place have a phone number (dial up ex: 1234566)
the other place have a number (dial up ex: 3456784) how can send and receive file between two softwares by dialup numbers
Writing your own file-sync mechanism may sound simple, but it is not easy, especially if you need to sync multiple parties.
Rather than writing your own sync tool, I would strongly encourage you to use SQL Server replication which is a feature built-in to SQL Server itself to support exactly the scenario you describe above.
If I am understanding your scenario:
You have a master database with all records from all branch sites
You have a subset of that data at each site - the latest copy of the master data plus any changes made at the local site
You periodically want to have each site dial-in to the master server and sync data back and forth so that your site-changes are pushed up to the master server and the master DB's changes are pushed out to the branch DB.
To support this scenario, you just configure your branch offices to dial-into the master office periodically, and configure SQL Server to replicate data as appropriate.
I've previously configured a 25-branch organization to use dial-up and broadband connections to sync a large SQL Server production database in less than 2 days, including time to update their backup strategy to account for the needs of the replication strategy employed.
Compared to writing your own sync engine, using SQL Server replication will likely save you many months' of development effort and many man-years of debugging & operational support!
You don't want to be dealing with dial-up yourself. Investigate Windows RAS, which sets up a TCP/IP connection between two hosts using dial-up. It can be driven from C#.
Once you've done that, investigate SQL Server Replication in order to sync the data once the connection is up.

C# Multiuser Database Connection

I am tasked with creating a central Database for a small office to allow multiple computers to connect to a database using a C# program. I have already written the program and it currently connects with a database that is in the bin folder.
I am completely lost as to how to move on to creating a multi user environment. I searched all around SO and tried downloading Microsoft SQL Server, but I have no idea how I would set this up in the office and allow it to be accessed from multiple computers. Also, from the information I've gathered, Microsoft SQL Server needs to be running at all times to allow a connection -- this isn't a deal breaker, but is there any other methods that wouldn't need this? There isn't exactly a "main computer" in the office that is always running.
To run a centralized sql server database in your office you would at a minimum setup sql server on a "server". The server can be pretty simple unless you expect a heavy user load.
The server has to be on in order to allow connections.
Sql Server exists in a free version called Sql Server express, but it has limitations when it comes to scalability, so it's not meant for large systems.
You can download it and install it on your server in the office and connect to it through a connection string in your application.
You can also consider open source platforms like mySQl, but it would still require a central server.
Alternatively you can consider a hosted solution where you have a company host the database for you in their data center.
If you do not have the server computer in your office that will host the DBMS and allow others to connect to your DB using the web interface, try to use Windows Azure. This will cost you some money. Here you need to estimate what is cheaper for you: purchase a server or pay for the azure.

Entity Framework, Offline Use Strategies?

I am currently learning about EF and have come into a scenario where the data should be used in both an online and offline mode.
It is assumed that the user will have to use the system first while connected to obtain the data used offline.
I thought about serializing the queries but IQueryable/ObjectQuery are not marked as serializable.
How would I go about being able to store results from a few queries locally and then restoring them in offline mode so the use can continue to use the app? I could spend days researching this but I hope somebody can point me in the right direction.
EDIT
It is worth noting that the master SQL Server instance is a shared server that has very minimal features installed. Replication for example, is not installed.
Assuming you are using SQL Server, you vcould take a look at SQL server compact.
http://msdn.microsoft.com/en-us/data/ff687142.aspx
You could copy data from your main DB into a locally stored CE database then switch to this for offline.

Any suggestions on data syncronization from a server to a desktop?

I have a web based CRM system that stores all the client data from all the clients into one database (MS Sql Server). We need to build a system that maintains a local copy of the data for each client. So basically the client database will have all tables and columns except for the ClientId that is in ever server table. I am aware that I will need to add fields to the server to support synchronization.
Are there any good solutions or components already out there to help me accomplish this?
We are using MS Sql Server and .NET C#
SQL Server vs. a local one (express) - this is what MS does in it's CRM.
Sync framework (part of SQL Server etc.) could be helpful to programming a sync mechanism, in case you do not want to use replication here - which MAY work.

Categories

Resources