Hi all,
I have a problem. Been pulling my hair out all day with this. Had a number
of errors, but now I am so close. This is connecting to OpenLDAP on a linux
box. My app is an ASP.NET app in C#.
System.Director yServices.Direc toryEntry entryPC = new
System.Director yServices.Direc toryEntry();
entryPC.Path =
"LDAP://MyLDAPServer389/ou=pens,dc=anot es,dc=com";
string sFilter =
String.Format(" (&(objectClass= pen)(descriptio n={0}))", PenIDTextBox.Te xt);
entryPC.Authent icationType =
System.Director yServices.Authe nticationTypes. Anonymous;
System.Director yServices.Direc torySearcher ds = new
System.Director yServices.Direc torySearcher(en tryPC);
ds.Filter = sFilter;
ds.SearchScope = System.Director yServices.Searc hScope.Subtree;
System.Director yServices.Searc hResult sr = null;
bool SRFailed = false;
try
{
sr = ds.FindOne();
}
catch(Exception ex)
{
SRFailed = true;
}
The path is correct as I can connect to it with an LDAP Browser.
When I run it, I am dropping into the catch and getting an error "The
parameter is incorrect", which is about as helpful as praying for it to
work.
Inside my ou=pens, I have a branch (an endpoint) of serialNumber=0x 000....
(hex number). There are two of these. Inside these, I have various
attributes, 3 objectClass (one of them has the value "pen" and a description
attribute with the value that I am searching for.
If I put my sFilter value in my LDAP Browser search routine, then I get the
result (but only if I scan the subtree).
Absolutely any help, even if you don't know the answer but possible have
noticed something I may have missed will be helpful.
Thanks.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available