New answers tagged


You need to point edit to an existing workspace object not the base class. So you need to get a handle on the workspace you intend to edit before you point an IWorkspaceEdit interface to it. Search the API help for the page "Editing with the geodatabase API" there are several code samples to get you going.


This should answer your question:


You can not cast a FeatureClass into a ILayer! Here's the proper way to reach an ILayer from a FeatureClass: .... IFeatureLayer fl = new ESRI.ArcGIS.Carto.FeatureLayer() fl.FeatureClass = FC; var l = fl as ILayer; axMapControl1.AddLayer(l); I am assuming all of your previous methods are correct and you have a valid IFeatuerClass (FC).


More generally, perhaps the question should be "How can I persist PropertySets in an Mxd?" If so, use an extension, implementing both IExtension and IPersistVariant. See "How to persist data in a document". It's from 9.3, but still relevant.

Top 50 recent answers are included