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", "");
Rohit Gupta
3332 gold badges4 silver badges10 bronze badges
asked Jan 27, 2018 at 16:22
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. 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. 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. 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) 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. Commented Jan 27, 2018 at 22:24

1 Answer 1

1

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

answered Sep 13, 2018 at 13:47

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.