NotImplementedException when I use IADsContainer.Count

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm getting NotImplementedException when I tried to get the Count property
from the IContianer object iconComputers. What does this error mean? How
can I correct this problem? Thanks.


//deGlobalComputers is a DirectoryEntry .
IADsContainer iconComputers =
(IADsContainer)deGlobalComputers.NativeObject;
IADsContainer iconUsers =
(IADsContainer)deGlobalComputers.NativeObject;
IADsContainer iconGroups =
(IADsContainer)deGlobalComputers.NativeObject;
iconComputers.Filter = new object[] {"meeting"};
int numOfComputers = iconComputers.Count;
 
Hi Pucca,

This could be the issue (pay attention to the last line):

The enumeration processes under IADsContainer::get__NewEnum and IADsContainer::get_Count are performed against the contained objects
in the cache. When a container contains a large number of objects, the performance may be affected. To enhance performance, turn off
the cache, set up an appropriate page size, and use the IDirectorySearch interface. For this reason, the get_Count property is not
supported in the Microsoft LDAP provider.

Source Page on MSDN:
http://msdn.microsoft.com/library/d.../adsi/adsi/iadscontainer_property_methods.asp
 
Thnak you.
--
Thanks.


Dave Sexton said:
Hi Pucca,

This could be the issue (pay attention to the last line):

The enumeration processes under IADsContainer::get__NewEnum and IADsContainer::get_Count are performed against the contained objects
in the cache. When a container contains a large number of objects, the performance may be affected. To enhance performance, turn off
the cache, set up an appropriate page size, and use the IDirectorySearch interface. For this reason, the get_Count property is not
supported in the Microsoft LDAP provider.

Source Page on MSDN:
http://msdn.microsoft.com/library/d.../adsi/adsi/iadscontainer_property_methods.asp

--
Dave Sexton

Pucca said:
I'm getting NotImplementedException when I tried to get the Count property
from the IContianer object iconComputers. What does this error mean? How
can I correct this problem? Thanks.


//deGlobalComputers is a DirectoryEntry .
IADsContainer iconComputers =
(IADsContainer)deGlobalComputers.NativeObject;
IADsContainer iconUsers =
(IADsContainer)deGlobalComputers.NativeObject;
IADsContainer iconGroups =
(IADsContainer)deGlobalComputers.NativeObject;
iconComputers.Filter = new object[] {"meeting"};
int numOfComputers = iconComputers.Count;
 
Back
Top