473,327 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Exception while querying an AD

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(Boole an
throwIfFail)\r\n at
System.DirectoryServices.DirectoryEntry.Bind()\r\n at
System.DirectoryServices.DirectoryEntry.get_AdsObj ect()\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[i]);

results = ds.FindAll();
}
}
}
catch (Exception e)
{
...

Anyone can help to figure out how I can deal with that?
Thanks
Nov 18 '05 #1
0 907

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Fazan | last post by:
I'm using Tim Golden's WMI implementation (http://tgolden.sc.sabren.com/python/wmi.html) version 0.6 along with pywin32 build 202. I'm able to successfully query WMI in the main thread but not in...
2
by: Marlon | last post by:
Code posted below ( I am not sure which group to post to, but I need help) I wrote a Windows Form Application to query the IIS MimeMap on the localhost which worked fine. I ran the same code...
6
by: Greg | last post by:
I am working on a project that will have about 500,000 records in an XML document. This document will need to be queried with XPath, and records will need to be updated. I was thinking about...
2
by: Richard L Rosenheim | last post by:
I loaded a XSLT stylesheet into a XMLDocument to retrieve some of the data. I received an exception when the SelectNodes method was invoked. The message was "System.Xml.XPath.XPathException -...
5
by: Shane | last post by:
I wonder if someone has any ideas about the following. I am currently producing some reports for a manufacturing company who work with metal. A finished part can contain multiple sub-parts to...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
0
by: Marlon | last post by:
Code posted below I wrote a Windows Form Application to query the IIS MimeMap on the localhost which worked fine. I ran the same code in asp.net and got "Access is Denied" exception. What...
2
by: Dominik | last post by:
After going productive a few days ago, we had a very strange exception on of our loadbalanced productive servers running a Microsoft Content Management Server ASP.Net application. As this exception...
1
by: blabla120 | last post by:
Hi folks, I am net to NHibernate, and I hava a read baisc/general question. In my database (PostgreSQL), I have an unique index laying on the field transaktionsnummer which is located in the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.