RIA Service 从数据库取不到数据,但做插入操作是可以的?
public void DrawLine() { DeepEarthDemo.Web.DomainService1 client = new DeepEarthDemo.Web.DomainService1(); DeepEarthDemo.Web.WaterMeter waterMeter = new DeepEarthDemo.Web.WaterMeter(); var sel = from s in client.WaterMeters where s.ID == 1 select s; if (sel.Count() == 0) return; DeepEarthDemo.Web.WaterMeter wm = sel.First(); string str = wm.PointList; MatchCollection matchs = Regex.Matches(str, @"\d+"); List<Point> points = new List<Point>(); for (int i = 0; i < matchs.Count; i += 2) { int x = Convert.ToInt32(matchs[i].Value); int y = Convert.ToInt32(matchs[i + 1].Value); Point p = new Point(x, y); pointList.Add(p); } AddLine(geoLayer, pointList); }