我正在尝试SpatialObject
在 C# 中创建 a 并通过 a 将其传递给我的 SQL Server 数据库
DataSet
,但我不知道如何将它传递给DataSet
:/
当我尝试将元素添加到 DS 的参数时,它只是作为参数
CONVERT(geography, '')
但没有收到任何东西,有什么办法可以将对象传递给 DS 还是应该通过存储过程来完成?
这是我正在使用的代码的一部分
SqlGeographyItem.BeginGeography(OpenGisGeographyType.Point);
string RadioLatLng = Points.Remove(Points.Length - 1);
string[] tokens = RadioLatLng.Split(',');
decimal.TryParse(HiddenRadio.Value, out Radio);
SqlGeographyItem.BeginFigure(Convert.ToDouble(tokens[1]), Convert.ToDouble(tokens[0]));
SqlGeographyItem.EndFigure();
SqlGeographyItem.EndGeography();
SqlGeographyFig = SqlGeographyItem.ConstructedGeography;
SqlGeographyFig.STBuffer(Convert.ToDouble(Radio));
DS_GeofenceTableAdapters.Geofence1TableAdapter ta_geocercas = new DS_GeofenceTableAdapters.Geofence1TableAdapter();
DS_GeofenceTableAdapters.GeofenceClientTableAdapter tagc = new GeofenceClientTableAdapter();
int IdGeo = Convert.ToInt32(ta_geocercas.InsertQuery(4, this.txt_nombre.Text, Type, Points, Buffer, DateTime.Now, "Active", Radio, Color, route));