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

How do I know if a directory entry has no children object?

I'm building a treeview and a list view. I need to know when I reached the
end of the tree nodes, which means that node or directory entry has no
children. Is there a property or method in DirectoryEntry class that does
this? If not, how can I verify this?
--
Thanks.
Jul 17 '06 #1
2 4713
Pucca wrote:
I'm building a treeview and a list view. I need to know when I reached
the end of the tree nodes, which means that node or directory entry has no
children. Is there a property or method in DirectoryEntry class that does
this? If not, how can I verify this?
Hi Pucca,

Are you asking about the TreeNode, if it doesn't have any children, or the
DirectoryEntry, if it doesn't have any children?

For the former, simply use the Count property of the Nodes property of the
TreeNode. If the latter, then there's no exposed method to return the
number of children in a DirectoryEntry. If you provide a bit more
information, we may be able to suggest alternatives.

For example, are you recursively building the TreeView?

--
Hope this helps,
Tom Spink

Google first, ask later.
Jul 17 '06 #2
I have a treeview on the left panel and a Listview on the right panel.
Similar to one sees in the Active Driectory computer, users and groups
console.

If user clicks on a node on the left(treeview) then I would expand the node
if there are children and then I list these children nodes in the Listview on
the right.

I'm getting NullRefreneceException when I click on the Users or the Group
node which needs to list all the user and group objects on the listview and
this is where I'm getting the error when testing for the description either
value != null or descriptoin length >0.

if
(child.Properties["description"].Value.ToString() != null)
NodeDetail.Items.Add(new
ListViewItem(new string[] { split[1].ToString(),
child.Properties["description"].Value.ToString() }, 4));
else
NodeDetail.Items.Add("Name",
split[1].ToString(), 4);
--
Thanks.
"Tom Spink" wrote:
Pucca wrote:
I'm building a treeview and a list view. I need to know when I reached
the end of the tree nodes, which means that node or directory entry has no
children. Is there a property or method in DirectoryEntry class that does
this? If not, how can I verify this?

Hi Pucca,

Are you asking about the TreeNode, if it doesn't have any children, or the
DirectoryEntry, if it doesn't have any children?

For the former, simply use the Count property of the Nodes property of the
TreeNode. If the latter, then there's no exposed method to return the
number of children in a DirectoryEntry. If you provide a bit more
information, we may be able to suggest alternatives.

For example, are you recursively building the TreeView?

--
Hope this helps,
Tom Spink

Google first, ask later.
Jul 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: MIchele | last post by:
Hi I want to access via VB.Net the active directory I want to list all the users and groups in AD and, if it's possible, also the exchange mailbox of each users.. Anyone can help me? Please... ...
1
by: Publickey | last post by:
Hi, I am having trouble setting the user's cn value using VB .NET 2002 while creating a new user account. The code is as below: ***********************Start of code****************************...
2
by: Jacky Luk | last post by:
Hi all, If I need to make a C# application, do I need to set up a virtual dir such as inetroot on the Harddisks. How do I set up such thingy? Thanks Jack
1
by: Philip Carnstam | last post by:
Hi, Can someone lead me through creating a user object in AD. I have tried creating one through LDAP and ADSI (WinNT://) but nothing happens. Thanks, Philip
0
by: Ireneus Broncel | last post by:
I have a class which reads Groups and Users from ActiveDirectory. The Problem is, that i have about 10000 rows as product. When I am trying to read the "memberOf" Objects out of this field i get...
6
by: varkey.mathew | last post by:
Dear all, Bear with me, a poor newbie(atleast in AD).. I have to authenticate a user ID and password for a user as a valid Active Directory user or not. I have created the IsAuthenticated...
3
by: Jan Wrage | last post by:
Hi! I would like to implement a treeview in my existing application. It should show my entire Active-Directory structure, i.e. all Groups, Containers and OUs. Could somebody help me with...
10
by: Hriday | last post by:
Hi there, Please help me..It is urgent This is Hriday, working on windows authentication with Active Directory... My requirment is when a user sends a request to my web Applicatoin I want to...
0
by: Richard | last post by:
Hello, I have write this code for retry a Virtual Directory in IIS.. Dim site As DirectoryEntry = New DirectoryEntry("IIS://MYPC/W3SVC/1/ROOT", "USER", "PWD") Dim Entry As DirectoryEntry Dim...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.