public static SqlBytes SerializeSqlGeographyMultiPoint(Point2dCollection points2d) { var result = ""; foreach (Point2d point in points2d) { if (points2d.IndexOf(point) == 0) { result = String.Format("MULTIPOINT (({0} {1} {2})", point.X, point.Y, 0); } result += String.Format(",({0} {1} {2})", point.X, point.Y, 0); } result += ")"; //, null)"; SqlGeometry multipoint = SqlGeometry.STMPointFromText(new SqlChars(result), 0); return(multipoint.Serialize()); }