var motorwaysLayer = new ShapeFileFeatureLayer(shapeFileName, motindexFileName,ShapeFileReadWriteMode.ReadOnly); var primaryLayer = new ShapeFileFeatureLayer(shapeFileName, primindexFileName, ShapeFileReadWriteMode.ReadOnly); var secondaryLayer = new ShapeFileFeatureLayer(shapeFileName, secFileName, ShapeFileReadWriteMode.ReadOnly);
etc.
This all works fine when displaying, but when I try to edit the values it all fails. If I change the motorways layer to be ReadWrite opening it throws the exception that file is in use by other process when I do this
What is the proper way to edit features in this scenario ? Or do I have to create separate shapefiles and than remerge them ? Or is there some other way how to display different types of roads differently with the same shape file ?
I think there would be some problems if we are trying to open the same target shape files with both readonly and readwirte modes even it is working perfectly when multiple users are consuming it with ReadOnly mode, this is the same rule as what .net library has done against the disk files. As you said it definitely should work if we can achieve this by using the separate shape files and then remerge them at the appreciate time.
While personally a better solution is probably by using the service, any end users cannot be allowed to edit the file directly , what they can do is just trying to send a edit request to the service which is responsible to the edit it, this is just what I thought, I am not sure it can help in your case.
Any more questions please feel free to let me know.
you confirmed what I have to do now. The only problem is that the shapefiles might have to get remerged, because of at the moment unknown performance of multiple shape files layer, when creating the routing graph.
I plan to have one user at a time. Creating the service would be an option, but at this moment I have to keep this simple (and since I don't have the experience to create a service in a reasonable time I'll have to pass that way).