简体   繁体   中英

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. 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?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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