By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,213 Members | 1,478 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,213 IT Pros & Developers. It's quick & easy.

Trying to fill a drop down list with all company users, but...

P: n/a
I am new to .NET (and directory services) and I need to fill a drop down list box with the users of my company. I am trying to use the code shown below, but I get this error message when the line of code with the "For" statement runs: "System.Runtime.InteropServices.COMException: The specified domain either does not exist or could not be contacted
Can anyone give me any ideas as how to resolve this? Any and all help would be greatly appreciated. Thanks
Dim DirSearch As New DirectorySearcher(userDSE
DirSearch.SearchScope = SearchScope.Subtre
DirSearch.PropertiesToLoad.Add("name"
DirSearch.PropertiesToLoad.Add("mail"
DirSearch.Filter = "(objectcategory=user)
For Each sr As SearchResult In DirSearch.FindAll <-- ERROR OCCURS HER
Dim li As New ListIte
li.Text = sr.Properties("Name")(0
li.Value = sr.Properties("Name")(0
ddlReporter.Items.Add(li
Next
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Rickl,

I do not know the answer of your problem, I can give you the answer to check
for IS nothing before however that gives no answer.

When I was you I would try it as well in the newsgroups
microsoft.public.dotnet.languages.vb
microsoft.public.dotnet.security
microsoft.public.dotnet.framework 'wmi small however active newsgroup

And then crosspost it that means one messages to more newsgroups in one
time.

I hope you find your answer,

Cor
I am new to .NET (and directory services) and I need to fill a drop down list box with the users of my company. I am trying to use the code shown
below, but I get this error message when the line of code with the "For"
statement runs: "System.Runtime.InteropServices.COMException: The specified
domain either does not exist or could not be contacted" Can anyone give me any ideas as how to resolve this? Any and all help would be greatly appreciated. Thanks.

Dim DirSearch As New DirectorySearcher(userDSE)
DirSearch.SearchScope = SearchScope.Subtree
DirSearch.PropertiesToLoad.Add("name")
DirSearch.PropertiesToLoad.Add("mail")
DirSearch.Filter = "(objectcategory=user)"
For Each sr As SearchResult In DirSearch.FindAll <-- ERROR OCCURS HERE
Dim li As New ListItem
li.Text = sr.Properties("Name")(0)
li.Value = sr.Properties("Name")(0)
ddlReporter.Items.Add(li)
Next

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.