When trying to use SqlGeograpy I get the following error:

Unhandled Exception: System.ArgumentException: Specified type is not registered on the target server.Microsoft.SqlServer.Types.SqlGeography, Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91.

I am facing the above exception while adding SQLGeography type as command.parameter even if I can see that I have that library in my SQL Server assemblies (select * from sys.assemblies)

command.Parameters.Add(new SqlParameter("@deviceGeolocation", SqlDbType.Udt) { UdtTypeName = "Geography", Value = geo, });
0

There are 0 best solutions below