G
Guest
Good Day Folks,
I'm trying to do an LDAP search of Novell eDirectory, but I'm getting a
compile error.
The error and my code are listed below.
Any ideas ?
Thanks in advance
/Serge
Compile error message
---------------------------
'System.DirectoryServices.SearchResult.Private Sub New(parentCredentials As
System.Net.NetworkCredential, parentAuthenticationType As
System.DirectoryServices.AuthenticationTypes)' is not accessible in this
context because it is 'Private'.
My code
---------
<%@ Page Language="vb" AutoEventWireup="false"
CompilerOptions='/R:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\system.directoryservices.dll"' Debug="true" %>
<%@ Import Namespace="System.DirectoryServices" %>
<html>
<head>
<title></title>
</head>
<body>
<%
Const ADConnectionString As String =
"LDAP://grnbds2.ocdsb.edu.on.ca/ou=GREENBANK, ou=DIST5, o=OCDSB"
Dim oConnection As New DirectoryEntry(ADConnectionString)
Dim oSearcher As New DirectorySearcher(oConnection)
Dim oSearchResults As SearchResultCollection()
Dim oSearchResult As New SearchResult ' this is the line with the error.
oSearcher.Filter = "(objectClass=user)"
oSearchResults = oSearcher.FindAll()
For Each oSearchResult In oSearchResults
Response.write(oSearchResult.Properties("name").ToString & "<br />")
Next
%>
</body>
</html>
--
I'm trying to do an LDAP search of Novell eDirectory, but I'm getting a
compile error.
The error and my code are listed below.
Any ideas ?
Thanks in advance
/Serge
Compile error message
---------------------------
'System.DirectoryServices.SearchResult.Private Sub New(parentCredentials As
System.Net.NetworkCredential, parentAuthenticationType As
System.DirectoryServices.AuthenticationTypes)' is not accessible in this
context because it is 'Private'.
My code
---------
<%@ Page Language="vb" AutoEventWireup="false"
CompilerOptions='/R:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\system.directoryservices.dll"' Debug="true" %>
<%@ Import Namespace="System.DirectoryServices" %>
<html>
<head>
<title></title>
</head>
<body>
<%
Const ADConnectionString As String =
"LDAP://grnbds2.ocdsb.edu.on.ca/ou=GREENBANK, ou=DIST5, o=OCDSB"
Dim oConnection As New DirectoryEntry(ADConnectionString)
Dim oSearcher As New DirectorySearcher(oConnection)
Dim oSearchResults As SearchResultCollection()
Dim oSearchResult As New SearchResult ' this is the line with the error.
oSearcher.Filter = "(objectClass=user)"
oSearchResults = oSearcher.FindAll()
For Each oSearchResult In oSearchResults
Response.write(oSearchResult.Properties("name").ToString & "<br />")
Next
%>
</body>
</html>
--