Hi all, I'm in an environment of VB.NET, ASP.NET and Novell eDirectory 8.5*. What I need to do is to retrieve all customers (about 10000+) with their firstname and lastname. I tried to use System.DirectorySearcher, but its performance of retrieving and looping
thru such big amount of data to display on .aspx page is very very slow, especially looping thru the SearchResultsCollection took a lot of time. Back in VB6 world, I had some working code that used ADO (Command & RecordSet, etc) to query the same LDAP server.
Then I wonder if ADO.NET can work the same way, that's where the following test code came from. Also I wonder if ADO.NET, particularly OleDbDataReader (or maybe OleDbDataAdapter), can speed things up. If yes, the result of DataSet will make things such as
binding to a dropdown much easier. The following is my test code, but it errors out in the bold section. (maybe I used dr in a wrong way?) Does anybody know how to make it work? Anybody can provide a good working example? (I have been googling for it , but
can't find one) In a word, any of your input will be great!! Thank you!! '========================================= Dim oConnection As OleDbConnection Dim oCmd As OleDbCommand Dim dt As DataTable = New DataTable() Dim strADOQuery As String Dim strFilter As
String oConnection = New OleDbConnection() oCmd = New OleDbCommand() oConnection.ConnectionString = "Provider=ADsDSOObject;" oConnection.Open() oCmd.Connection = oConnection '// Build the query string strFilter = "(objectclass=user)" '// Execute the query
strADOQuery = ";" + strFilter + ";" + "givenname,sn" + ";subtree" oCmd.CommandText = strADOQuery oCmd.CommandTimeout = 600
Dim dr As OleDbDataReader dr = oCmd.ExecuteReader While dr.Read Dim strTemp As String strTemp = dr.GetValue(0) End While
aspworker
Member
10 Points
2 Posts
How to query LDAP server by using ADO.NET
Aug 06, 2003 08:42 PM|LINK