2

我有一个有一个数据库的网站 我也有一个有数据库的桌面应用程序

我想将数据从桌面应用程序数据库复制到网站数据库,换句话说,桌面应用程序将充当发布者和分发者,而网站将充当订阅者。这是一个中央订阅者场景。

我的问题是我该怎么做,我的意思是它是通过代码(RMO 或其他方式)还是 Sql Server 2008(Transct-SQL)完成的

以及如何通过桌面应用程序的设置添加复制?

以及如何配置网站数据库进行复制?

请帮助我,我以前从未从事过复制工作。我只是希望有人向我解释这样做的正确方法或方式。只是要点作为指导,其余的我会自己弄清楚

中央订户

4

2 回答 2

2

我认为使用 SMO 或完全从头开始编写自己的解决方案会带来太多开销。

你看过了Web Synchronization for Merge Replication吗?它基本上是经典的 SQL Server 发布者/订阅者合并复制,但通过 IIS 在 Web 上完成。

您甚至可以在发布者处将您的一些文章设置为只读,这样您在订阅者处对它们所做的修改将不会被带回(如果您愿意,可以模拟事务复制)。

于 2012-06-30T20:50:53.580 回答
0

You can definitely use SQL Server merge replication via IIS. I do this with my clients right now and it works great. I think you're mixing your terms up though, causing more confusion than is necessary. There is no reason to think of the laptops as 'publishers', at least not in SQL terms. They can still be subscribers, but if you use merge replication, then that means the laptops will send data both ways (take data from the server, and send data to the server). My situation is to have a SQL server on our IIS server (or you can separate those servers for a more secure enviro), and synchronize through RMO to the laptops to a WPF application of mine. These laptops don't need IIS or SQL server installed on them, you can replicate to a SQL Compact database easily using RMO.

Additionally you can look into using WCF, microsoft synchronization services. But that requires more work i think, and i have less experience there.

于 2012-06-30T23:37:06.140 回答