S
Sociando
Hi,
I've a problem for querying an LDAP after a while. I mean that the
query method works for a while, and suddenly I've the error, and the
only way I found to make it work again is to log off/ log on !
The error is: An operations error occurred
System.Runtime.InteropServices.COMException
Source "System.DirectoryServices"
StackTrace " at System.DirectoryServices.DirectoryEntry.Bind(Boolean
throwIfFail)\r\n at
System.DirectoryServices.DirectoryEntry.Bind()\r\n at
System.DirectoryServices.DirectoryEntry.get_AdsObject()\r\n at
System.DirectoryServices.DirectorySearcher.FindAll(Boolean
findMoreThanOne)\r\n at
System.DirectoryServices.DirectorySearcher.FindAll()\r\n at
DirectoryLookup.Class1.Query(String path, String filter, String[]
propertiesToLoad)
Here is the code I'm using:
try
{
using (DirectoryEntry de = new DirectoryEntry(_path))
{
using (DirectorySearcher ds = new DirectorySearcher(de))
{
if (filter != null)
ds.Filter = filter;
for (int i = 0; i <= propertiesToLoad.Length - 1; i++)
ds.PropertiesToLoad.Add(propertiesToLoad);
results = ds.FindAll();
}
}
}
catch (Exception e)
{
...
Anyone can help to figure out how I can deal with that?
Thanks
I've a problem for querying an LDAP after a while. I mean that the
query method works for a while, and suddenly I've the error, and the
only way I found to make it work again is to log off/ log on !
The error is: An operations error occurred
System.Runtime.InteropServices.COMException
Source "System.DirectoryServices"
StackTrace " at System.DirectoryServices.DirectoryEntry.Bind(Boolean
throwIfFail)\r\n at
System.DirectoryServices.DirectoryEntry.Bind()\r\n at
System.DirectoryServices.DirectoryEntry.get_AdsObject()\r\n at
System.DirectoryServices.DirectorySearcher.FindAll(Boolean
findMoreThanOne)\r\n at
System.DirectoryServices.DirectorySearcher.FindAll()\r\n at
DirectoryLookup.Class1.Query(String path, String filter, String[]
propertiesToLoad)
Here is the code I'm using:
try
{
using (DirectoryEntry de = new DirectoryEntry(_path))
{
using (DirectorySearcher ds = new DirectorySearcher(de))
{
if (filter != null)
ds.Filter = filter;
for (int i = 0; i <= propertiesToLoad.Length - 1; i++)
ds.PropertiesToLoad.Add(propertiesToLoad);
results = ds.FindAll();
}
}
}
catch (Exception e)
{
...
Anyone can help to figure out how I can deal with that?
Thanks