Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 从DbGeometry创建DbGeography_.net_Sql Server_Google Maps - Fatal编程技术网

.net 从DbGeometry创建DbGeography

.net 从DbGeometry创建DbGeography,.net,sql-server,google-maps,.net,Sql Server,Google Maps,我正在使用Google Maps Api for.NET,它为我提供了一个DbGeometry,但我需要将位置作为DbGeography存储在数据库中。如何从DbGeometry转换为DbGeometry?如果数据库表中已经有了它,可以执行以下操作: select geography::STGeomFromText(cast(yourGeomCol as varchar(max)), 4326) from yourTable

我正在使用Google Maps Api for.NET,它为我提供了一个DbGeometry,但我需要将位置作为DbGeography存储在数据库中。如何从DbGeometry转换为DbGeometry?

如果数据库表中已经有了它,可以执行以下操作:

select geography::STGeomFromText(cast(yourGeomCol as varchar(max)), 4326)
from yourTable