I want to read/write the properties "Lat" and "Long" of a spot for which I have created a template. I was expecting to be able to read/write it the follwing way:
- Code: Select all
const string query = "SELECT * FROM SELF WHERE ObjectType = Spot";
var resultSet = Session.RunQuery(query, refSelf);
//MessageBox.Show(resultSet.Rows.Count.ToString());
foreach (var obj in resultSet.Rows)
{
Hotspot hotspot = new Hotspot();
hotspot.Name = obj.GetDisplayName();
hotspot.HotspotType = obj.GetTemplateTechnicalName();
if (obj.HasProperty("Lat") && obj.HasProperty("Lon"))
{
MessageBox.Show(obj["Lat"].ToString() + " " + obj["Lon"].ToString());
hotspot.Lat = Convert.ToSingle(obj["Lat"]) ;
hotspot.Lon = Convert.ToSingle(obj["Lon"]);
}
hotspots.Add(hotspot);
}
However that seems to be incorrect. Can you guide me?
thanks and cheers
Martin