Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 7th, 2007, 10:08 PM
Registered User
Join Date: Apr 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error querying LDAP


I usually only participate in the C/C++ forum but i guess desperate times need desperate measures.

Well, i am trying to query an LDAP through DirectoryServices but can't seem to get it right and need ur help in the matter.

Here's the code i am using..

strUID = Request.ServerVariables("HTTP_UID")

Dim Entry As System.DirectoryServices.DirectoryEntry
Entry = New DirectoryEntryldap://myserver:401/ou=people,o=org, "uid=myid,o=org", "pwd123")
Dim Search As DirectorySearcher = New DirectorySearcher(Entry)
Search.Filter = "(micid=" & strUID & ")"
Dim Results As SearchResult = Search.FindOne()
strfname = Results.Properties("givenname")(0).ToString()

The error i am getting is :
The parameter is incorrect.

I got a hunch that the user id i am using i.e uid=myid,o=org
is the cause of the problem as the server is taking it as more than one parameter.
But don't know how to fix it..

Can anybody help..??

Thanks a lot..


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using "." while querying database..asp gives error Shuchik Classic ASP Basics 2 September 17th, 2007 02:47 AM
Querying a textfile in QA daniel SQL Server 2000 10 February 1st, 2006 01:51 AM
Querying Recordset with a Loop rabu Access VBA 10 December 14th, 2005 04:49 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.