Hi all,
I am using the File Geodatabase API v.1.5.1 with .NET and when I try to insert a new row into an existing Feature Class, I get the following the error "The user does not have permission to execute the operation".
1. Geodatabase geodatabase = Geodatabase.Open(@"C:\temp\MyTest.gdb");
2. Table table = geodatabase.OpenTable("\\MyFeatureClass");
3. Row newRow = table.CreateRowObject();
4. PointShapeBuffer sb = new PointShapeBuffer();
5. sb.Setup(ShapeType.Point);
6. Point point = new Point(x,y);
7. sb.point = point;
8. newRow.SetGeometry(sb);
9. table.Insert(newRow);
10. geodatabase.Close();
What I have noticed is that the property table.IsEditable is false in my test. In the "Editing" sample that comes with the API it works fine when they open the "Cities" Feature class. The property table.IsEditable is set to true. Is this related to the problem I am seeing?
BTW the geo database I am playing with, is created in ArcGis Pro 2.4.2.
Is there a way to solve the issue?
Many thanks in advance,
Greg
Solved! Go to Solution.
Apparently there are limitations that prohibit users from altering the data. Below is an extract from the manual.
Limitations of the File Geodatabase API
While the File Geodatabase API supports reading the schema and data of complex geodatabase types, the API does not honor geodatabase behavior on inserts, deletes or updates to the following dataset types:
In most cases the API will prevent users from attempting to edit objects with complex behavior, but the onus is on the developer to understand what they should and should not edit through the API and avoid editing datasets that have geodatabase behavior. There is a method called Table::IsEditable which will provide developers with the ability to determine whether a dataset can be safely edited.
Other limitations of the File Geodatabase API:
I found this Geodatabase Error (-2147220987): The user does not have permission to execute the operation. which doesn't help at all as I am not using any writer. In fact I do not know what they are. I just use file geodatabase API to open a db from file and insert a row into a feature class.
Apparently there are limitations that prohibit users from altering the data. Below is an extract from the manual.
Limitations of the File Geodatabase API
While the File Geodatabase API supports reading the schema and data of complex geodatabase types, the API does not honor geodatabase behavior on inserts, deletes or updates to the following dataset types:
In most cases the API will prevent users from attempting to edit objects with complex behavior, but the onus is on the developer to understand what they should and should not edit through the API and avoid editing datasets that have geodatabase behavior. There is a method called Table::IsEditable which will provide developers with the ability to determine whether a dataset can be safely edited.
Other limitations of the File Geodatabase API: