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

  • Thread starter Thread starter Guest
  • Start date Start date
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!!
 
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.
 
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
 
Back
Top