[英]No mapping exists from DbType System.DateTimeOffset to a known SqlCeType
I have a SQL Server 2008 database that contains DateTimeOffset objects. 我有一个包含DateTimeOffset对象的SQL Server 2008数据库。 As per this page ,
根据此页面 ,
SQL Server Compact provides support for replicating the new data types in SQL Server 2008 such as date, time, datetime2, datetimeoffset, geography, and geometry.
SQL Server Compact为复制SQL Server 2008中的新数据类型(例如日期,时间,datetime2,datetimeoffset,地理和几何)提供了支持。 The new data types in SQL Server 2008 are mapped to nchar, nvarchar, image, etc. For more information about data types in SQL Server 2008, see Data Types in SQL Server 2008 Books Online Documentation.
SQL Server 2008中的新数据类型映射到nchar,nvarchar,图像等。有关SQL Server 2008中的数据类型的更多信息,请参见SQL Server 2008联机丛书中的数据类型。
However, when I use the Microsoft Sync Framework and try to sync my SQL Server database to a SQL Server Compact database, I get the following error: 但是,当我使用Microsoft Sync Framework并尝试将SQL Server数据库同步到SQL Server Compact数据库时,出现以下错误:
No mapping exists from DbType System.DateTimeOffset to a known SqlCeType.
从DbType System.DateTimeOffset到已知SqlCeType的映射不存在。
The relevant Microsoft Sync Framework documentation is here . 相关的Microsoft Sync Framework文档在此处 。 I am on SQL CE 3.5 SP2 and .NET Framework 4.0.
我使用的是SQL CE 3.5 SP2和.NET Framework 4.0。
I'm kind of lost here. 我有点迷路了。 What am I doing wrong?
我究竟做错了什么?
What version of ADO.NET and .Net Compact Framework are you using? 您正在使用哪个版本的ADO.NET和.Net Compact Framework? The docs for Sync FW v2.0 and v2.1 indicate that wrt
datetimeoffset
Sync FW v2.0和v2.1的文档指示wrt
datetimeoffset
If the server provider is hosted on a computer that is running ADO.NET 2.0 SP1, ADO.NET 2.0 SP1 must also be available on the client for conversion to succeed.
如果服务器提供程序托管在运行ADO.NET 2.0 SP1的计算机上,则ADO.NET 2.0 SP1在客户端上也必须可用,以便成功进行转换。 Automatic conversion of datetimeoffset on the client is not supported by .NET Compact Framework 2.0 SP1 or .NET Compact Framework 3.5.
.NET Compact Framework 2.0 SP1或.NET Compact Framework 3.5不支持在客户端上自动转换datetimeoffset。
That is consistent with your error. 那与你的错误是一致的。
不支持DateTimeOffset-文档中提到的类型转换是针对合并复制而不是Sync Framework的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.