Geeks With Blogs

News

This blog has moved to ericnelson.wordpress.com

 Subscribe in a reader

Add to Google Reader or Homepage


Links
View my teams slideshare
These postings are provided "AS IS" with no warranties, and confer no rights.



IUpdateable has moved to ericnelson.wordpress.com Please visit http://ericnelson.wordpress.com

This one has come up a few times. LINQ to SQL and LINQ to Entities in V1 do not currently support the newest types added to SQL Server 2008 nor do they support your own User Defined Types.

More specifically:

  • LINQ to SQL does not support the hierarchyID, geospatial, table or time types. UDTs are not supported. It does support the new DateTimeOffset , DateTime2, and Date types (NB: I have not tried this and I think it may require SP1)
  • LINQ to Entities does not support hierarchyID or geospatial. I haven’t yet checked the other new types but I believe they are also not supported. UDTs are not supported.

If you need to work with UDTs or the new types then you will either a) need to use traditional ADO.NET for those aspects of your application or b) lean on stored procedures to mask those types from L2S/L2E or c) do something creative.

An example of doing something creative is this post on working with geospatial via a DefiningQuery in the SSDL and some binary manipulation.

Posted on Wednesday, January 21, 2009 5:21 PM .NET 3.5 , Data , Entity Framework , Data Services , SQL Server , Q&A | Back to top


Comments on this post: QandA: How can I use LINQ with new data types in SQL Server 2008 such as the geospatial types?

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Eric Nelson | Powered by: GeeksWithBlogs.net