PC Review


Reply
Thread Tools Rate Thread

ADO.NET and Active Directory

 
 
Mario Rodriguez
Guest
Posts: n/a
 
      16th Mar 2004
Hi people, there is a way to make searches on active directory thru
ADO.NET?, so the result is an DataSet object and not a DirectoryENtry object

thanks


 
Reply With Quote
 
 
 
 
Paul Clement
Guest
Posts: n/a
 
      16th Mar 2004
On Tue, 16 Mar 2004 09:56:22 -0600, "Mario Rodriguez" <(E-Mail Removed)> wrote:

¤ Hi people, there is a way to make searches on active directory thru
¤ ADO.NET?, so the result is an DataSet object and not a DirectoryENtry object
¤

You can use the native .NET OLEDB library with the ADsDSOObject provider

Function QueryActiveDirectory() As Boolean

Dim ADConnection As New System.Data.OleDb.OleDbConnection("Provider=ADsDSOObject;")

ADConnection.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("select name, ADsPath from
'LDAP://DC=xxx,DC=xxx,DC=org' WHERE objectCategory='organizationalUnit' or objectCategory='group'",
ADConnection)

Dim ds As New DataSet

da.Fill(ds, "ADResults")

frmMain.DataGrid1.SetDataBinding(ds, "ADResults")

ADConnection.Close()

End Function


Paul ~~~ (E-Mail Removed)
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
Marc Scheuner [MVP ADSI]
Guest
Posts: n/a
 
      17th Mar 2004
>Hi people, there is a way to make searches on active directory thru
>ADO.NET?, so the result is an DataSet object and not a DirectoryENtry object


No, not out of the box. Also, in .NET, you can easily use the
DirectorySearcher class, which is quite easy and nice to use, really
(compared to the olden days of IDirectorySearch......)

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Reply With Quote
 
Mario Rodriguez
Guest
Posts: n/a
 
      17th Mar 2004
DirectorySearcher returns an DirectoryEntry Collection or a DataSet ???


"Marc Scheuner [MVP ADSI]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> >Hi people, there is a way to make searches on active directory thru
> >ADO.NET?, so the result is an DataSet object and not a DirectoryENtry

object
>
> No, not out of the box. Also, in .NET, you can easily use the
> DirectorySearcher class, which is quite easy and nice to use, really
> (compared to the olden days of IDirectorySearch......)
>
> Marc
> ================================================================
> Marc Scheuner May The Source Be With You!
> Bern, Switzerland m.scheuner(at)inova.ch



 
Reply With Quote
 
Marc Scheuner [MVP ADSI]
Guest
Posts: n/a
 
      18th Mar 2004
>DirectorySearcher returns an DirectoryEntry Collection or a DataSet ???

It returns a DirectoryEntry on the .FindOne(), or a
SearchResultCollection in the .FindAll() methods. In both cases,
definitely *NOT* a data set.

MArc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      18th Mar 2004
On Wed, 17 Mar 2004 07:52:22 +0100, Marc Scheuner [MVP ADSI] <(E-Mail Removed)> wrote:

¤ >Hi people, there is a way to make searches on active directory thru
¤ >ADO.NET?, so the result is an DataSet object and not a DirectoryENtry object
¤
¤ No, not out of the box. Also, in .NET, you can easily use the
¤ DirectorySearcher class, which is quite easy and nice to use, really
¤ (compared to the olden days of IDirectorySearch......)

Well, actually you most certainly can query AD via ADO.NET (see the example in my post). The
ADsDSOObject provider is available to ADO.NET via the native .NET OLEDB library just as it was for
ADO and OLEDB.


Paul ~~~ (E-Mail Removed)
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question on upgrading from active directory 2000 to active directory 2003 Gary M Microsoft Windows 2000 Active Directory 2 16th Mar 2007 08:57 PM
Active Directory, Active Directory Federation Services and Microsoft Integration Identiy Server Mas Libman [MSFT] Microsoft Windows 2000 Active Directory 0 6th May 2005 11:55 PM
[Active Directory] On what ground does LDAP connect to Active Directory RTT Microsoft VB .NET 0 12th Apr 2005 05:20 PM
Arguments for 2003 Active directory versus 2000 active directory? =?Utf-8?B?c3RlcGhlbmJiYWtlcg==?= Microsoft Windows 2000 Active Directory 4 23rd Dec 2003 05:40 AM
compatibility between W2K Active Directory and W2k3 Active Directory Dani Microsoft Windows 2000 Active Directory 1 15th Sep 2003 12:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:12 PM.