Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add new feature to file GDB feature class and keep getting this error: Objects in this class cannot be updated outside an edit session. Feature class has attachments enabled (exists relationships). Googled alot about this problem and still can't figure it out. FYI I'm developing a standalone application. My code:

Public Shared Sub CreateFeature(ByVal workspace As IWorkspace, ByVal featureClass As IFeatureClass, ByVal point As ArcGIS.Geometry.IPoint, ByVal data As String) 
    Dim workspaceEdit As IWorkspaceEdit = CType(workspace, IWorkspaceEdit) 
    Dim featureBuffer As IFeatureBuffer = featureClass.CreateFeatureBuffer() 
    Dim featureCursor As IFeatureCursor = featureClass.Insert(True) ' <- at this point error occurs
    Dim featureOID As Object 
    featureBuffer.Value(featureBuffer.Fields.FindField("Data")) = data 
    featureBuffer.Shape = point 
    featureOID = featureCursor.InsertFeature(featureBuffer) 
End Sub  
share|improve this question
What error are you getting? Did you try calling IFeatureClass.Insert(false) instead? Is this a standalone exe, if so are you initializing the license? What license level are you at? Can you successfully edit the featureclass with arcmap? – Kirk Kuykendall Mar 24 '13 at 15:27
The error is: Objects in this class cannot be updated outside an edit session. If I call IFeatureClass.Insert(false) I get the same error. This is a standalone exe and I am initializing the license on startup. I am at ArcInfo license (ArcGIS 10). I can edit the featureclass with ArcMap. – DTT Mar 25 '13 at 6:08
Do you get an error with featureClass.CreateFeature(), then calling IFeature.Store() ? – Kirk Kuykendall Mar 25 '13 at 13:20
same problem with featureClass.CreateFeature(), then calling IFeature.Store() – DTT Mar 25 '13 at 14:22
up vote 0 down vote accepted

Figured it out. It was a license binding issue. I was using: ESRI.ArcGIS.RuntimeManager.BindLicense(ProductCode.Desktop)

instead of: ESRI.ArcGIS.RuntimeManager.BindLicense(ProductCode.Desktop, LicenseLevel.GeodatabaseUpdate)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.