SqlCommand cmd = new SqlCommand("SELECT STATEMENT",ConnectionString);
connectionString.Open();
SqlDataReader polygon = cmd.ExecuteReader();
While (polygon.read())
{
string kmlCoordinates = string.Empty;
SqlGeography geo = (SqlGeography)polygon["GeoColumn"];
for(int i = 1; i <= geo.STNumPoints(); i++)
{
SqlGeography point = geo.STPointN(i);
kmlCoordinates += point.Long + "," + point.Lat + " ";
}
{
ConnectionString.Close();