473,498 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1611
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
8530
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
4011
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
2029
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
321
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
4548
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
7326
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
14161
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
1166
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
1330
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
7126
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
7168
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
7210
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...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.