问题
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?
回答1:
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.
回答2:
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
来源:https://stackoverflow.com/questions/7065503/sql-ce-in-wp7-mango-datatype-mapping-from-sql-server-2008