阅读:1143回复:0
请教C#里MO的问题
<P>我在C#里用下列语句往空白图层里加数据怎么不行:</P>
<P>MapObjects2.Point Pt=new MapObjects2.PointClass(); MapObjects2.MapLayer Layer=new MapObjects2.MapLayerClass(); MapObjects2.DataConnection Dc=new MapObjects2.DataConnectionClass(); string Path="D:\\sc\\demo\\EmptyMap";</P> <P> Dc.Database=Path; Layer.GeoDataset=Dc.FindGeoDataset("PointLayer"); Point=new MapObjects2.PointClass(); Point=mapMain.Extent.Center; Layer.Records.AddNew(); Layer.Records.Fields.Item("Shape").Value=Point; Layer.Records.Update(); mapMain.Layers.Add(Layer); mapMain.Refresh(); mapMain.CtlRefresh();</P> |
|