不存在从 DbType System.DateTimeOffset 到已知 SqlCeType 的映射

发布于 2024-09-25 01:30:43 字数 775 浏览 3 评论 0原文

我有一个包含 DateTimeOffset 对象的 SQL Server 2008 数据库。根据此页面

SQL Server Compact 支持复制 SQL Server 2008 中的新数据类型,例如日期、时间、datetime2、datetimeoffset、地理和几何。 SQL Server 2008 中的新数据类型映射为 nchar、nvarchar、image 等。有关 SQL Server 2008 中数据类型的详细信息,请参阅 SQL Server 2008 联机丛书文档中的数据类型。

但是,当我使用 Microsoft Sync Framework 并尝试将 SQL Server 数据库同步到 SQL Server Compact 数据库时,出现以下错误:

不存在从 DbType System.DateTimeOffset 到已知 SqlCeType 的映射。

相关的 Microsoft Sync Framework 文档位于此处。我使用的是 SQL CE 3.5 SP2 和 .NET Framework 4.0。

我有点迷失在这里。我做错了什么?

I have a SQL Server 2008 database that contains DateTimeOffset objects. 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. 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.

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:

No mapping exists from DbType System.DateTimeOffset to a known SqlCeType.

The relevant Microsoft Sync Framework documentation is here. I am on SQL CE 3.5 SP2 and .NET Framework 4.0.

I'm kind of lost here. What am I doing wrong?

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

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

发布评论

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

评论(2

哽咽笑 2024-10-02 01:30:43

您使用什么版本的 ADO.NET 和 .Net Compact Framework? Sync FW v2.0v2.1 表示 wrt datetimeoffset

如果服务器提供商托管在计算机上
正在运行 ADO.NET 2.0 SP1、ADO.NET 2.0 SP1
还必须可以在客户端上进行转换
成功。 datetimeoffset自动转换
.NET 不支持客户端
Compact Framework 2.0 SP1 或 .NET
紧凑框架3.5。

这与你的错误是一致的。

What version of ADO.NET and .Net Compact Framework are you using? The docs for Sync FW v2.0 and v2.1 indicate that 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. Automatic conversion of datetimeoffset
on the client is not supported by .NET
Compact Framework 2.0 SP1 or .NET
Compact Framework 3.5.

That is consistent with your error.

痞味浪人 2024-10-02 01:30:43

不支持 DateTimeOffset - 文档提到的类型转换用于合并复制,而不是同步框架

DateTimeOffset is not supported - the type conversions the doc mention are for Merge Replication, not Sync Framework

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