This operation is not allowed while editing error

المشرف العام

Administrator
طاقم الإدارة
When I tried to delete a feature, I got :This operation is not allowed while editing" error when I wanted to refresh version.

The related code is:

'Start Editing Operation lpWorkSpaceEdit.StartEditing(True) Do Until lpFeature Is Nothing Call CheckCPStatus(lpFeature, lbIsCPDead, lbIsCPNull) lpVerFC = lpObjSDEUtils.GetFeatureClass(lpCreatWS, lsLayerName) If Not lpVerFC.GetFeature(lpFeature.OID) Is Nothing Then lpVerFeat = lpVerFC.GetFeature(lpFeature.OID) lpVerFeat.Delete() End If 'Iterate through the next feature lpFeature = lpFeatCursor.NextFeature Loop 'Chech if the Created version has parent If lpCreatVer.HasParent Then lsParentVersionName = lpCreatVer.VersionInfo.Parent.VersionName Else MsgBox("You can only reconcile a version that has a parent.", MsgBoxStyle.Information, "App") End If 'Get the SDE Default's Latest Version 'lpVersionEdit.Reconcile(lsParentVersionName) lpCreatVer.RefreshVersion() lpVersionEdit.Reconcile(lsParentVersionName) If lpVersionEdit.CanPost Then lpVersionEdit.Post(lsParentVersionName) End If 'StopEditing Operation lpWorkSpaceEdit.StopEditing(True) lpVersionEdit.RefreshVersion()Is there anything wrong with my code? How can I delete a feature properly?



أكثر...
 
أعلى