我找到了一个关于在 .NET 中 sql server 2008 和 sql ce 3.5 之间映射数据类型的建议的 msdn 文档。这实际上显示了一个颜色编码矩阵。 不幸的是,我现在找不到它的链接。
但是,该文档建议使用 VARCHAR(MAX) / NVARCHAR(MAX) 和 DATETIME2,以便当 .NET 将它们转换为字符串时DateTime,它们将更好地匹配数据类型限制。据说(MAX)将转换为(4000)。
但是,当我尝试使用它们在 DataContext 中定义 ColumnAttribute 时,使用 (MAX) 和 DATETIME2 会出现编译和运行时错误。所以,我恢复为 (1000) 和 DATETIME。
现在这个文档关于“SQL Server Compact 和 SQL Server Compact 之间的差异SQL Server”表明 SQL CE 3.5 和 SQL CE 3.5 都支持 DATETIME2。 2008年。
当我尝试搜索“sql ce 3.5与wp7的兼容性”时,我没有得到任何有用的文档。
是否有任何帮助文档详细说明 SQL CE 3.5 for WP7 中允许的数据类型以及它们如何映射到 SQL Server 2008 数据类型?
I found a msdn doc on recommendations for mapping datatypes between sql server 2008 and sql ce 3.5 in .NET. 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. It was said that the (MAX) will be converted to (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. So, I reverted to (1000) and 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.
When I try to search for "sql ce 3.5 compatibility with wp7", I am not getting any useful document.
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?
发布评论
评论(2)
我自己一直在寻找这个并发现了这个页面:
http://msdn.microsoft.com/en-us/ library/ms172424(SQL.110).aspx
看起来 WP7 使用 SQL CE 4.0,我们需要坚持使用 datetime 和 ntext。
编辑:我在此页面上找到了上面的链接: http ://msdn.microsoft.com/en-us/library/hh202872(v=VS.92).aspx
I've just been looking for this myself and came across this page:
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.
EDIT: I found the link above on this page: http://msdn.microsoft.com/en-us/library/hh202872(v=VS.92).aspx
我相信您要访问的页面是此页面。无论您使用什么平台,SQL CE 3.5 都是相同的,因此问题的“WP7”部分并不重要。
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.