Microsoft Sync框架,Microsoft Entity Framework 4.1& SQL CE 4.0 [英] Microsoft Sync Framework, Microsoft Entity Framework 4.1 & SQL CE 4.0

查看:108
本文介绍了Microsoft Sync框架,Microsoft Entity Framework 4.1& SQL CE 4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个偶尔连接的应用程序,该应用程序在客户端计算机上使用SQL Compact,在服务器上使用SQL Server 2008(具有更改跟踪).该应用程序是使用Entity Framework的代码优先模型开发的,该模型要求本地SQL Compact数据库为4.0.我们想使用Microsoft Sync Framework处理从中央服务器到偶尔连接的客户端的数据同步,但是最近发现,尽管SQL Compact 3.5 SP2与Sync Framework兼容,但4.0不兼容(

We are developing an occasionally connected application that uses SQL Compact on the client machines and SQL Server 2008 (with change tracking) on the server. The application is being developed using Entity Framework’s code first model, which requires that the local SQL Compact database be 4.0. We would like to use Microsoft Sync Framework to handle synchronizing data from the central server to the occasionally connected clients but recently discovered that while SQL Compact 3.5 SP2 is compatible with Sync Framework, 4.0 is not (http://blogs.msdn.com/b/sqlservercompact/archive/2011/01/12/microsoft-sql-server-compact-4-0-is-available-for-download.aspx). We wanted to use SQL Compact for this application to leverage the SQLCEClientSyncProvider provided by Microsoft and were unable to find a SQL Express equivalent. It seems we are left with a couple options:

1)编写一个自定义同步提供程序,以在客户端上利用SQL Express.从我所看到的情况来看,这不是一项琐碎的任务,而紧迫的最后期限使这具有很大的风险. 2)使用SQL Compact 3.5 SP2,并将实体框架代码从代码优先"模型转换为模型优先"模型.我不确定这种方法会涉及到什么,或者需要多少返工.

1) Write a custom sync provider to leverage SQL Express on the client end. From what I have seen, this is not a trivial task and a tight deadline makes this quite risky. 2) Use SQL Compact 3.5 SP2 and convert the Entity Framework code from a "code first" model to a "model first" one. I am not sure what all would be involved in this approach or how much rework would be required.

我的问题:

是否存在更好的解决方案,可以一起使用我们不考虑的所有这些技术?哪种方法阻力最小?我很惊讶地发现,在客户端使用Sync Framework和SQL Express时,并没有得到完全的支持.对于SQL CE 4.0,Sync Framework兼容性是否即将到来?

Is there a better solution for using all of these technologies together that we are not considering? Which method would be the path of least resistance? I was surprised to find in my research that using Sync Framework with SQL Express on the client side is not more fully supported. Is Sync Framework compatibility something on the horizon for SQL CE 4.0?

推荐答案

Sync Framework有两种类型的数据库提供程序:脱机提供程序和协作/对等提供程序.

there are two types of database providers for Sync Framework: the offline provider and the collaboration/peer-to-peer provider.

脱机提供程序是SqlCeClientSyncProvider/DbServerSyncProvider,由Visual Studio中的本地数据库缓存"项目项使用,该项仅在客户端上支持SqlCe.

the offline providers are the SqlCeClientSyncProvider/DbServerSyncProvider which is used by the Local Database Cache project item in Visual Studio which only supports SqlCe on the client.

协作提供程序SqlCeSyncProvider/SqlSyncProvider在客户端和服务器上都支持SqlCe,Sql Express,Sql Server和Sql Azure.

the collaboration providers SqlCeSyncProvider/SqlSyncProvider supports SqlCe, Sql Express, Sql Server and Sql Azure on both client and server.

afaik,在不久的将来没有Sql Ce 4.0支持,也没有Sync Framework 4.0,只有2.1. MS最近发布了基于V4 CTP的Sync Framework Toolkit,但它的更多功能是将客户端支持扩展到非MS平台.

afaik, there is no Sql Ce 4.0 support in the near future and there is no Sync Framework 4.0, just 2.1. MS has recently released a Sync Framework Toolkit based on the V4 CTP but its more to expand the client support to non-MS platform.

话虽如此,我建议您使用SqlCeSyncProvider/SqlSyncProvider组合,因为它们可能需要最少的自定义量.

having said that, i suggest you go with the SqlCeSyncProvider/SqlSyncProvider combo as they probably require the least amount of customization.

请参阅:教程:同步SQL Server和SQL Server紧凑

这篇关于Microsoft Sync框架,Microsoft Entity Framework 4.1& SQL CE 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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