I am having a few problems loading a table into the designer. I get the following error.
One or more selected items contain a data type that is not supported by the designer
Would I be correct in assuming it is the geography type used in the table that is causing this error?
Any pointers much appreciated.
The geography spatial data type, geography, is implemented as a . NET common language runtime (CLR) data type in SQL Server. This type represents data in a round-earth coordinate system. The SQL Server geography data type stores ellipsoidal (round-earth) data, such as GPS latitude and longitude coordinates.
SQL Server supports two spatial data types: the geometry data type and the geography data type. The geometry type represents data in a Euclidean (flat) coordinate system. The geography type represents data in a round-earth coordinate system.
LINQ to SQL was the first object-relational mapping technology released by Microsoft. It works well in basic scenarios and continues to be supported in Visual Studio, but it's no longer under active development.
To correct this error:
or see this article The Missing Linq to SQL Spatial,This article provides hints and hacks on how to use the SQL Server spatial data types -Geography and Geometry- in Linq to SQL
Check below article / answer for the detail :
SqlGeography and Linq to Sql
Is it possible to use SqlGeography with Linq to Sql?
Spatial types are not supported by Linq to SQL. Support is not "not great" - it's nonexistent.
You can read them as BLOBs, but you can't do that by simply changing the column type in Linq to SQL. You need to alter your queries at the database level to return the column as a varbinary, using the CAST statement. You can do this at the table level by adding a computed varbinary column, which Linq will happily map to a byte[].
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With