Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.