what am I doing wrong? I'm trying to load Google Maps with data from the database and I am using the following code, but am having an error when I enter the foreach: "An exception of type 'System.Exception' occurred in GMaps.dll but was not handled in user code" "Additional information: Latitude must be beetwen -90 and 90"
if (!IsPostBack)
{
GLatLng mainLocation = new GLatLng(-18.8533, -41.9450);
GMapMyFriends.setCenter(mainLocation, 15);
XPinLetter xpinLetter = new XPinLetter(PinShapes.pin_star, "C", Color.Green, Color.White, Color.Chocolate);
GMapMyFriends.Add(new GMarker(mainLocation, new GMarkerOptions(new GIcon(xpinLetter.ToString(), xpinLetter.Shadow()))));
DataTable MyFriends = db.ExecuteSelect("SELECT lat ,lng FROM tblAdress;");
PinIcon p;
GMarker gm;
foreach (DataRow dtRow in MyFriends.Rows)
{
foreach (DataColumn dc in MyFriends.Columns)
{ p = new PinIcon(PinIcons.home, Color.Cyan);
gm = new GMarker(new GLatLng(Convert.ToDouble(dtRow["lat"]), Convert.ToDouble(dtRow["lng"])),
new GMarkerOptions(new GIcon(p.ToString(), p.Shadow())));
}
}
}
}