No mapping exists from object type Microsoft.SqlServer.Types.SqlGeography to a known managed provider native type.
Tom van Oost
0
Reputation points
I'm receiving the following error when storing data with DbGeography type in the database, using Entity Framework 6.4.4 and .NET 6:
No mapping exists from object type Microsoft.SqlServer.Types.SqlGeography to a known managed provider native type.
Using the latest version of Microsoft.SqlServer.Types: 160.1000.6.
Stacktrace:
System.Data.Entity.Infrastructure.DbUpdateException: An error occurred while updating the entries. See the inner exception for details.
---> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details.
---> System.Data.Entity.Core.EntityCommandCompilationException: An error occurred while preparing the command definition. See the inner exception for details.
---> System.ArgumentException: No mapping exists from object type Microsoft.SqlServer.Types.SqlGeography to a known managed provider native type.
at System.Data.SqlClient.MetaType.GetMetaTypeFromValue(Type dataType, Object value, Boolean inferLen, Boolean streamAllowed)
at System.Data.SqlClient.MetaType.GetMetaTypeFromType(Type dataType)
at System.Data.SqlClient.SqlParameter.GetMetaTypeOnly()
at System.Data.SqlClient.SqlParameter.get_SqlDbType()
Developer technologies | .NET | Other
Developer technologies | .NET | Other
Microsoft Technologies based on the .NET software framework. Miscellaneous topics that do not fit into specific categories.
Sign in to answer