Is This Content Helpful?
We're glad to know this article was helpful.
Looping through a recordset using IFeatureCursor may cause the following error:
"Layer in Use- Maximum number of streams exceeded"
Garbage collection takes care of releasing resources in managed code. This process is non-deterministic and will release resources at some undetermined time. In most cases this approach works fine, however in this situation it is necessary to mark the COM object as eligible for garbage collection so the resources will be released in a timely manner.
The following steps show how to mark the COM object as eligible for garbage collection.