Assign a IGeometry to Feature.Shape

المشرف العام

Administrator
طاقم الإدارة
I'm trying insert a feature into a FeatureClass, but when I try to assign the geometry to featurebuffer the app return the next Error: The remote procedure call failed. (Exception from HRESULT: 0x800706BE)

IWorkspaceEdit workspaceEdit = (IWorkspaceEdit)this._getWorkSpaceFromArcSDE();workspaceEdit.StartEditing(true);workspaceEdit.StartEditOperation();IFeatureClass fc = this.getFeatureClassFromArcSDE(layerName);IFeatureCursor pFeatureCursor;IFeatureBuffer pFeatureBuffer;IFeature pFeature;QueryFilter qf = QueryFilter)_pServerContext.CreateObject("esriGeodatabase.QueryFilter");qf.WhereClause = "";pFeatureCursor = fc.Search(qf, false);pFeature = pFeatureCursor.NextFeature();if (pFeature != null) pFeature.Delete();pFeatureBuffer = fc.CreateFeatureBuffer();pFeatureCursor = fc.Insert(true);**pFeatureBuffer.Shape = geometry;** //Here return the errorpFeatureCursor.InsertFeature(pFeatureBuffer);pFeatureCursor.Flush();workspaceEdit.StopEditOperation();workspaceEdit.StopEditing(true);Marshal.ReleaseComObject(pFeatureCursor);Marshal.ReleaseComObject(pFeatureBuffer);Marshal.ReleaseComObject(fc);

أكثر...
 
أعلى