好吧,我们使用ado.net来保存数据库。
using Microsoft.SqlServer.Types;
DataRow dr = dt.Rows[0];
dr["gps_location"] = SqlGeography.Point(30.0, 122, 4326); //ERROR
当它执行到最后一句时,它出错了。错误是
{“值的类型与列类型不匹配,不能存储在gps_location列中。预期的类型是SqlGeography。”}
这个gps_location在Sqlserver中的数据类型是地理