473,396 Members | 1,871 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,396 software developers and data experts.

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

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
1 1609
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
3
by: google | last post by:
This is something I've done plenty of times in '97, but I can't seem to get it to work correctly in Access 2003. Say, for example, I have a form with an unbound combobox, the data source is a...
1
by: csgraham74 | last post by:
Hi Guys, I am currently building a web aplication in ASP.Net. On the onload event of a page a have a function to populate the many drop down lists on my page. I have one parameter table which...
1
by: RickL | last post by:
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...
2
by: Ren | last post by:
Hi all, I am a bit new to PHP and SQL so this may seem like a dumb question. I have already created a drop down list as part of a form which is automatically populated with values taken from a...
3
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the...
4
by: magmike | last post by:
I've got a control on my form that allows the user to select a record based on a form field (in this example, the drop down menu shows the company name, followed by the contact name but uses the...
2
by: Boheim | last post by:
I have two controls on my page: 1) A list box 2)A drop down list I want my users to be able to select from the drop down list and the related data be shown in the list box. For example: lets...
1
by: Boheim | last post by:
I have two controls on my page: 1) A list box 2)A drop down list I want my users to be able to select from the drop down list and the related data be shown in the list box. For example: lets...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.