1

I want To create Feature Class in an enterprise geodatabase with ArcObjects. This is a small part of our plugin. In our case, we want to create a Feature Class in the database Identical to the layer that is in TOC. It creates that successfully, but when we add it to the TOC and want to edit it, ArcMap returns the message This data is not editable. The user has full permission.

It is possible to create Feature Class manually in geodatabase With a database Connection in the Catalog tree; It was successfully created and it is editable and I can Register it as versioned. But When I try to create a feature Class with Arcobjects it returns No editable Layer and I can't edit the feature Class.

SQL Server in use: Microsoft SQL Server 2008 Express Edition (64-bit) , version of ArcGIS in use: 10.2.2, the license level of ArcGIS: Advanced (ArcInfo) Concurrent Use.

This is our code:

        Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SqlWorkspaceFactory");
        IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);
        IPropertySet connectionProps = new PropertySetClass();
        connectionProps.SetProperty("SERVER", "gSERVER");
        connectionProps.SetProperty("INSTANCE", "sde:sqlserver:gSERVER-pc");
        connectionProps.SetProperty("DATABASE", "Ga");
        connectionProps.SetProperty("DBCLIENT", "SQLServer");
        connectionProps.SetProperty("SERVERINSTANCE", "gSERVER-pc\\sqlraSERVER"); 
        connectionProps.SetProperty("AUTHENTICATION_MODE", "OSA");
        IFeatureWorkspace workspace = (IFeatureWorkspace)workspaceFactory.Open(connectionProps, 0);
        IMxDocument mxd = ArcMap.Application.Document as IMxDocument;
        IMap map = mxd.FocusMap;
        ILayer layer = map.Layer[0] as ILayer;
        IFeatureLayer featurlayer = layer as IFeatureLayer;
        IFeatureClass fc = featurlayer.FeatureClass;
        IWorkspace wrk = workspace as IWorkspace;
        IFields fields = featurlayer.FeatureClass.Fields;
        IFeatureWorkspace hhj = workspace as IFeatureWorkspace;

        IFeatureClass outputFeatClass = hhj.CreateFeatureClass(featurlayer.Name, fields, featurlayer.FeatureClass.CLSID, null, featurlayer.FeatureClass.FeatureType, "SHAPE", "");
6
  • Please do not capitalize every other word. It Makes Reading More Difficult. Keep in mind that SDE does not exist, especially from ArcObjects. Please Edit the question to specify the exact SQL Server in use, the exact version of 10.2.x ArcGIS in use, and the license level of ArcGIS in your application.
    – Vince
    Commented Jan 27, 2018 at 16:43
  • SQL Server in use: Microsoft SQL Server 2008 Express Edition (64-bit) , version of ArcGIS in use: 10.2.2, the license level of ArcGIS: Advanced (ArcInfo) Concurrent Use.
    – arkadas
    Commented Jan 27, 2018 at 17:07
  • Please Edit the question in response to requests for clarification. It's not fair to those who would answer to need to mine the comments for critical information. I wonder if Express 2008 is even supported at 10.2.2. "Enterprise" geodatabases in Express are anything but enterprise-ready.
    – Vince
    Commented Jan 27, 2018 at 17:28
  • I have edited the question. It is possible to create Feature Class manually in geodatabase With database Connection in Catalog tree; It successfully created and it is editable and i can Register it as versioned . But When i try to create feature Class with Arcobjects it returns No editable Layer and i cant edit feature Class.(Above Code)
    – arkadas
    Commented Jan 27, 2018 at 21:02
  • Again, put these details in the question. You should be able to delete your comments without losing any information.
    – Vince
    Commented Jan 27, 2018 at 22:24

1 Answer 1

1

You are using the wrong Workspace Factory. Use "SDEWorkspaceFactory" instead of "SqlWorkspaceFactory"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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