简体   繁体   English

WP7 Mango 中的 SQL CE - 来自 SQL Server 2008 的数据类型映射

[英]SQL CE in WP7 Mango - Datatype mapping from SQL Server 2008

I found a msdn doc on recommendations for mapping datatypes between sql server 2008 and sql ce 3.5 in .NET.我在 sql 服务器 2008 和 .NET 中的 sql ce 3.5 之间找到了关于映射数据类型的建议的 msdn 文档。 This actually shows a color coded matrix.这实际上显示了一个颜色编码的矩阵。 Unfortunately I am not able to find the link to it now.不幸的是,我现在无法找到它的链接。

However, that doc recommended to use VARCHAR(MAX) / NVARCHAR(MAX) and DATETIME2 so that when .NET converts them to string & DateTime, they would better match the datatype limits.但是,该文档建议使用 VARCHAR(MAX) / NVARCHAR(MAX) 和 DATETIME2 以便当 .NET 将它们转换为字符串和日期时间时,它们将更好地匹配数据类型限制。 It was said that the (MAX) will be converted to (4000).据说(MAX)将转换为(4000)。

But when I tried to use them to define the ColumnAttribute in a DataContext use of (MAX) and DATETIME2 were giving compilation and runtime errors.但是,当我尝试使用它们在 DataContext 中定义 ColumnAttribute 时,使用 (MAX) 和 DATETIME2 会产生编译和运行时错误。 So, I reverted to (1000) and DATETIME.所以,我恢复到 (1000) 和 DATETIME。

Now this doc on " Differences Between SQL Server Compact and SQL Server " tells that DATETIME2 is supported in both SQL CE 3.5 & 2008.现在这篇关于“ SQL 服务器紧凑型和 SQL 服务器之间的差异”的文档告诉 SQL CE 3 都支持 DATETIME2。

When I try to search for "sql ce 3.5 compatibility with wp7", I am not getting any useful document.当我尝试搜索“sql ce 3.5 与 wp7 的兼容性”时,我没有得到任何有用的文档。

Is there any help doc detailing the datatypes allowed in SQL CE 3.5 for WP7 and how they map to SQL Server 2008 datatypes?是否有任何帮助文档详细说明 SQL CE 3.5 for WP7 中允许的数据类型以及它们如何从 map 到 Z9778840A0100CB30C9828767081B0B5A2Z 数据类型 20?

I believe the page you're after is this one .我相信您要查找的页面就是这一页。 SQL CE 3.5 is the same no matter what platform you're on, so the "WP7" part of the question doesn't matter. SQL CE 3.5 无论您在哪个平台上都是一样的,因此问题的“WP7”部分无关紧要。

I've just been looking for this myself and came across this page: http://msdn.microsoft.com/en-us/library/ms172424(SQL.110).aspx我自己一直在寻找这个并遇到了这个页面: http://msdn.microsoft.com/en-us/library/ms172424(SQL.110).aspx

Looks like WP7 uses SQL CE 4.0 and we need to stick to datetime and ntext.看起来 WP7 使用 SQL CE 4.0,我们需要坚持使用 datetime 和 ntext。

EDIT: I found the link above on this page: http://msdn.microsoft.com/en-us/library/hh202872(v=VS.92).aspx编辑:我在此页面上找到了上面的链接: http://msdn.microsoft.com/en-us/library/hh202872(v=VS.92).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM