so following this link
http://edndoc.esri.com/arcobjects/9.2/NET/91e3e8a0-d355-43d2-a201-0a8ceb719334.htm
I am able to convert my featureLayer into a shape file and export it.
However, some how for 1 specific layer that i tested with i always get this error:
Item NOT found in collection
during this piece of code:
IFeatureDataConverter featureDataConverter = new FeatureDataConverterClass();
IEnumInvalidObject enumInvalidObject =
featureDataConverter.ConvertFeatureClass(((IDataset)featureLayer.FeatureClass).FullName as IFeatureClassName,
null, null, targetFeatureClassName, targetGeometryDef, targetFields, "", 1000, 0);
// Check for errors.
IInvalidObjectInfo invalidObjectInfo = null;
enumInvalidObject.Reset();
while ((invalidObjectInfo = enumInvalidObject.Next()) != null)
{
// Handle the errors in a way appropriate to the application.
Debug.WriteLine("Errors occurred for the following feature: {0}, {1}",
invalidObjectInfo.InvalidObjectID, invalidObjectInfo.ErrorDescription);
result = false;
}
It does not crash, but the enumInvalidObject always gives me the error Item not found in this collection.
Does anyone have an idea on what may cause this, I know saying that ONE of my layer don't work is very vague, but i really dont know what is special about that layer.
It does export the shape file, but no features inside.
Thanks and Regards,
Kev84