Help! Error: Type 'DirectoryEnty' is not defined.

G

Guest

I'm new to .Net and would like to start using .aspx pages to work w/ Active
Directory instead of classic asp. I get this error when trying to run my
page:
Type 'DirectoryEnty' is not defined.

Can anyone tell me what is wrong? My code below:


<%@Page Explicit="True" Language="VB" Debug="True" %>
<%@ Import Namespace="System.DirectoryServices" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ASP.NET Temp User</title>
</head>

<script runat="server">
Sub add_user(sender As Object, e As EventArgs)

Dim strPath As String = "LDAP://OU=Belgium,DC=qmc,DC=com"
Dim myDE As New DirectoryEntry(strPath)

Dim myEntries As DirectoryEnty = myDE.Children.Add("CN=Test User", "user")

myEntries.CommitChanges()

End Sub
</script>

Many Thanks!!
 
B

Ben Lucas

The error is due to the misspelled "DirectoryEnty" It is trying to tell you
that it doesn't know what "DirectoryEnty" is. If you change it to
"DirectoryEntry" you should be able to compile your code.
 
G

Guest

Well I'll be darned! Boy do I feel silly. Thanks so much for lending me
your eyes!
 
M

Marc Scheuner [MVP ADSI]

Well I'll be darned! Boy do I feel silly.

A classic example of the PICNIC principle :)

Problem In Chair, Not In Computer <big innocent grin>

Happens to all of us, rest assured - we're only humans, after all

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top