title: SQL CE in WP7 Mango - Datatype mapping from SQL Server 2008
body: <p>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. <strong>Unfortunately I am not able to find the link to it now.</strong></p>
  
  <p>However, that doc recommended to use VARCHAR(MAX) / NVARCHAR(MAX) and DATETIME2 so that when .NET converts them to string &amp; DateTime, they would <strong><em>better match</em></strong> the datatype limits. It was said that the (MAX) will be converted to (4000).</p>
  
  <p>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.</p>
  
  <p>Now this doc on "<a href="http://msdn.microsoft.com/en-us/library/bb896140%28v=SQL.100%29.aspx" rel="nofollow">Differences Between SQL Server Compact and SQL Server</a>" tells that DATETIME2 is supported in both SQL CE 3.5 &amp; 2008.</p>
  
  <p>When I try to search for "sql ce 3.5 compatibility with wp7", I am not getting any useful document.</p>
  
  <p>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?</p>