问题描述
[code=csharp///<summary>///坐标点转面///</summary>publicvoidPointToPolygon(){try{m_dataImport=newDataImport();Workspaceworkspace=newWorkspace();DatasourceConnectionInfodatasourceConnectInfo=newDatasourceConnectionInfo();datasourceConnectInfo.EngineType=EngineType.OraclePlus;datasourceConnectInfo.Server="supermap";datasourceConnectInfo.Database="";datasourceConnectInfo.User="ztuser2";datasourceConnectInfo.Password="123456";datasourceConnectInfo.Alias="supermap";Datasourcem_datasource=workspace.Datasources.Open(datasourceConnectInfo);m_datasource=m_workspace.Datasources[0];DatasetVectordataset=m_datasource.Datasets["T_SCDK"]asDatasetVector;dataset.IsReadOnly=false;//boolisD=dataset.IsOpen;RecordsetmeC=dataset.GetRecordset(true,CursorType.Static);GeoRegionmeF=newGeoRegion();Point2DmePoint2D=newPoint2D();mePoint2D.X=37604288.8835;mePoint2D.Y=4469787.9417;Point2DsmePs=newPoint2Ds();mePs.Add(mePoint2D);mePoint2D.X=37604203.9551;mePoint2D.Y=4469672.9024;mePs.Add(mePoint2D);mePoint2D.X=37604183.6514;mePoint2D.Y=4469692.1909;mePs.Add(mePoint2D);meF.AddPart(mePs);Geometrymegeo=meF;meC.AddNew(megeo);dataset.Open();dataset.Append(meC);dataset.Close();Recordsetrecordset=dataset.Query("SmID<500",CursorType.Static);DatasetVectordataset1=m_datasource.Datasets["T_SCDK"]asDatasetVector;dataset.Open();dataset1.Append(recordset);dataset.Close();m_mapControl.Map.ViewEntire();m_mapControl.Map.Refresh();layersTree1.Map.Refresh();}catch(Exceptionex){MessageBox.Show(ex.Message);}}][/code]meC.AddNew(megeo);报错为只读,不能修改
解决方案
本帖最后由 u012429684 于 2015-12-11 11:01:49 编辑
解决方案二:
插入数据还是用INSERT语句吧,这种方式太老了点.