SqlGeography geog = o.ToString(); --instead of SqlGeography geog = (SqlGeography)o; -- or someling like what I suggested SqlGeography geog = o as SqlGeography;The latter is a bit safer as if you hard cast
Apple a = (Apple)orange; --you get runtime exception, but if you soft cast Apple a = orange as Apple;then you get **a is null** but no error, that is until you try to use it still avoiding the code blowup with polite if (a != null) a.Color = "Red";
No one has followed this question yet.