如何同步三个不同客户端应用程序使用的三个独立数据库? [英] How to sync three separate databases used by three different client apps?

查看:138
本文介绍了如何同步三个不同客户端应用程序使用的三个独立数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

以下是问题所在:

我从我的教授处获得了一项任务,通过这样做来演示使用Microsoft Sync Framework:

  1. 创建三个基本相同的数据库(即所有数据库都包含相同的表,例如'用户')
  2. 创建三个不同的客户端应用程序。一个应该是使用其中一个创建的数据库的Windows窗体应用程序,另外两个应该是分别使用其他两个数据库的APS.NET网站。
  3. 每个应用程序都应该有一个向/从自己的数据库插入(和获取)数据的基本方法,并且应该将对该数据库的每个更改反映(同步)到其他两个数据库中,以便其他应用程序可以立即看到这些更改。

我知道这听起来很愚蠢,因为我可以创建一个数据库,并在每个应用程序中使用相同的数据库,但这就是我必须这样做的。

解决方案

是的可能。您正在查看的场景是MSF将其分类为点对点或协作场景。

如果您下载SDK,则可以查看SharingAppDemo-CEProviderEndToEnd示例。唯一的问题是样本中的第一个数据库必须是SQL Server或SQL Express,但您可以从中创建/提供多个SQL Compact(sdf)数据库,并且可以将它们全部同步。

查看协作方案: http://msdn.microsoft的.com / EN-US /库/ bb902853(v = SQL.105)的.aspx

 


Hello everyone!

Here's the problem:

I got an assignment from my professor to demonstrate the use of Microsoft Sync Framework by doing this stuff:

  1. Create three databases that are basically the same (i.e. all of them contain the same table, for example 'Users')
  2. Create three different client applications. One should be a Windows Forms application that uses one of the created databases, and the other two should be APS.NET WebSites that use the other two databases respectively.
  3. Every application should have a basic means of inserting (and getting) data to/from it's own database, and every change to that database should be reflected (synchronized) into the other two databases so that the other application can see those changes right away.

I know that this sounds silly because I could just create one database and use that same database from every application, but this is how I have to do it.

解决方案

yes its possible. the scenario you're looking at is what MSF would classify as peer-to-peer or collaboration scenario.

if you download the SDK, you can take a look at the SharingAppDemo-CEProviderEndToEnd sample. The only catch is that the first DB in the sample has to be either in SQL Server or SQL Express but you can create/provision multiple SQL Compact (sdf) databases from it and you can sync them all together.

check out the collaboration scenario at : http://msdn.microsoft.com/en-us/library/bb902853(v=SQL.105).aspx

 


这篇关于如何同步三个不同客户端应用程序使用的三个独立数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆