0

I Want To create Feature Class in an enterprise geodatabase with ArcObjects. This is the small part of the our plugin. In our case, we want to Create 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 Return the message that "This data is not editable". The user has full permissions . 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. 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", "");

bumped to the homepage by Community 11 hours ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

  • 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 Jan 27 '18 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 Jan 27 '18 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 Jan 27 '18 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 Jan 27 '18 at 21:02
  • Again, put these details in the question. You should be able to delete your comments without losing any information. – Vince Jan 27 '18 at 22:24
0

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, privacy policy and cookie policy

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