我可以使用 Sync Framework 同步移动、桌面和 Web 服务器数据库吗?

发布于 2024-07-17 14:03:11 字数 668 浏览 4 评论 0原文

我正在使用 Sync Framework v1(其中包括 Sync Services for ADO.NET v2)和 Sync Services for mobile v1。

我可以将移动设备上的 SQL Compact Edition 数据库同步到台式电脑上的 SQL Express。

我还可以使用 WCF 将 SQL CE 数据库从台式 PC 同步到 Web 服务器上的 SQL Server 数据库。

我想在对接时从移动设备同步到桌面,然后让桌面 PC 与 Web 服务器同步(桌面计算机上的副本是为了防止 Web 连接不可靠)。

理想情况下,无论如何我都想避免使用 SQL Express,因为我想要移动和 SQL Express。 桌面设置尽可能简单。

不幸的是,似乎无法将这些部分组合在一起以建立我需要的连接,因为:

  1. 移动设备同步到 PC 上的 SQL Express,而我无法从 SQL Express 同步到 SQL Server。
  2. 同步到 SQL Server 必须来自 SQL CE,并且我无法将移动设备同步到桌面上的 SQL CE

这是不可能的,还是可能需要大量代码(自定义 SyncProviders 和手工制作的更新语句等) ),还是我错过了一些明显的事情?

谢谢你的时间! 标记。

I'm using Sync Framework v1 (which includes Sync Services for ADO.NET v2) and Sync Services for mobile v1.

I can sync a SQL Compact Edition database from a mobile device to SQL Express on a desktop PC.

I can also sync a SQL CE database from a desktop PC to a SQL Server database on a web server using WCF.

I want to sync from the mobile device to the desktop when it docks, and then have the desktop PC sync with the web server (the copy on the desktop machine is in case the web connection is unreliable).

Ideally, I'd like to avoid SQL Express anyway because I want the mobile & desktop setups to be as simple as possible.

Unfortunately, it looks like there's no way to fit these pieces together to make the connections I need because:

  1. The mobile device syncs to SQL Express on the PC, and I can't sync from SQL Express to SQL server.
  2. Syncing to SQL server has to come from SQL CE, and I can't sync the mobile device to SQL CE on the desktop

Is this just not possible, or possible with a large amount of code (custom SyncProviders and hand-crafted update statements etc), or have I missed something obvious?

Thanks for your time!
Mark.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暮光沉寂 2024-07-24 14:03:11

我在实时应用程序中使用相同的基本设置,并且运行得很好。 我使用 Web 服务将移动设备与服务器同步(WCF 也可以),并且桌面应用程序在某种程度上同步像这样,一切都非常顺利。

一般来说,让客户端与服务器同步,然后服务器与服务器同步是一个坏主意,因为这样你就必须管理更多的状态,而常用的工具和指南对你没有多大帮助。

我还建议不要使用 sql 合并复制,除非您认为自己是管理 SQL 的专家,因为如果您现在不是专家,那么当您感到可以安全地使用它时,您就会成为专家。

请注意,如果您愿意花费时间和精力来创建自己的同步框架提供程序,那么您会发现几乎没有什么是您做不到的。

I am using the same basic setup for a live application and it is working pretty well. I have the mobile device sync with the server using web services (WCF would also be fine) and I have the desktop app syncing somewhat like this and everything works really smooth.

Generally it would be a bad idea to have a client sync with a server who then syncs with a server because then you have to manage more state and the common tools and guides will not help you much.

I would also recommend against using sql merge replication unless you consider yourself an expert at managing SQL, because if you are not one now you will be one by the time you feel safe using it.

As a note, if you are willing to spend the time and effort in making your own Sync Framework providers, then you will find there is little you cannot do.

夜未央樱花落 2024-07-24 14:03:11

我认为“预期”模式是在桌面上使用 SQl Express 并使用合并复制到服务器。

我不期望您可以在桌面上使用 SqlCe 作为 Sync 框架的“服务器”端。 其中,SqlCe 是单用户,这不适用于 SyncAgent。 即使它在您的情况下看起来可行。

可能有效的方法是让移动设备与服务器同步,桌面也与服务器同步。 但我意识到这并不能解决您的连接问题,并且可能会使 PC 上的副本变得多余。

I suppose the 'intended' pattern would be to use SQl Express on the desktop and use merge-replication to the server.

I don't expect that you can use SqlCe on the desktop as the 'server' end for the Sync framework. Amongst others, SqlCe is single user and that won't do for the SyncAgent. Even if it might seem workable in your situation.

What might work is to have the Mobile sync with the server and the desktop with the server too. But i realize that doesn't solve your connection problem and may make the copy on the PC superfluous.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文