简体   繁体   中英

access local database from live website C#

I have my live website. The website has 150 users. Whenever any new data is inserted by users, it is saved to online SQL server database.

As for backup I have installed MS SQL Server on my computer. And I have set timer in Global.asax file for 5 minutes.

I want to sync data between my computer and online database when this timer elapses.

How to sync these 2 SQL server properly?

I would suggest you to look into Peer-To-Peer Transnational Replication

Peer-to-peer replication provides a scale-out and high-availability solution by maintaining copies of data across multiple server instances, also referred to as nodes. Built on the foundation of transactional replication, peer-to-peer replication propagates transactionally consistent changes in near real-time. This enables applications that require scale-out of read operations to distribute the reads from clients across multiple nodes. Because data is maintained across the nodes in near real-time, peer-to-peer replication provides data redundancy, which increases the availability of data

Another way is the following steps

Step 1 Open Microsoft SQL Server by clicking "Start," then "Microsoft SQL Server," then "SQL Server Management Studio."

Step 2 Click "Tools," then "Options," then SQL Server Object Explorer" in Management Studio to open the object explorer.

Related Reading: How to Restore a SQL Database From a .MDF File

Step 3 Right-click the "Databases" folder in Object Explorer, and click "Synchronize" from the drop-down menu. The Synchronize wizard appears.

Step 4 Enter the source database information in the text field. Enter the source server information in the server text field if the database resides on an external server. Click "Next."

Step 5 Select your security type. The default settings set compression for all data and metadata. Click "Next."

Step 6 Click "Finish." The local database and source database begin synchronization.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM