473,809 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why does it take much time to open a searchresultcol lection?

3 New Member
Hello I am trying to write a litte program which let users search für other users with an LDAP connection.
It works fine with some search operations but it takes a very long time to "open" the searchresult object, it produces an COMException with some querys, others work fine. i have no idea why this takes this much time. if i debug step by step the .FindAll() works fine but the message box takes about 3 seconds or produces an exception. the result is limited to 300 results by the server.

my problem is that the Searchresultcol lection object opens very slowly or produces an exception. maybe someone can help me out?

thanks in advance.

System.Director yServices.Direc toryEntry entry = new System.Director yServices.Direc toryEntry(ldapc on);
entry.Authentic ationType = AuthenticationT ypes.ReadonlySe rver;
System.Director yServices.Direc torySearcher mysearcher = new System.Director yServices.Direc torySearcher(en try);

mysearcher.Prop ertiesToLoad.Ad d("sn");
mysearcher.Prop ertiesToLoad.Ad d("gn");
mysearcher.Prop ertiesToLoad.Ad d("department") ;
mysearcher.Prop ertiesToLoad.Ad d("l");
mysearcher.Prop ertiesToLoad.Ad d("c");
mysearcher.Prop ertiesToLoad.Ad d("mail");
mysearcher.Prop ertiesToLoad.Ad d("tcgid");
mysearcher.Size Limit = 300;
mysearcher.Filt er = filter;
SearchResultCol lection results = mysearcher.Find All();
MessageBox.Show (results.Count. ToString());
foreach (SearchResult rs in results)
{
Apr 25 '12 #1
4 3153
RhysW
70 New Member
This error is linked sometimes to it not having access/permission to view/access the folder you want it to search. Are you sure this isnt the problem? i can see you are making your code access the directories so there is a chance it can access most of them but maybe not some, which would explain why some queries work and others dont (the ones that dont probably try to access something its not allowed to do)
Apr 25 '12 #2
Senser
3 New Member
I am not quit sure, but if i reduce the size limit to about 200~250 the code works.(takes some time but complete the foreach) if i change the value over 260 it crashes every time.

I've tested your point(simply split my error query in 5 parts) and every single part with about 50 results works. Do you have any other idea what could be the problem? I also noticed that if i debug step by step and i click at the "+" at results right after i passed Find.All() it also crashes.

Thanks


EDIT:
I also got the VB Code which works fine but i don't know how to change it correctly to c#

Public Sub sucheSCD(sel As String, where As String, ByRef objRecordset As ADODB.Recordset , ByRef objConnection As ADODB.Connectio n)
Dim strsql As String
Dim strAdd As String

Dim serverSCD As String

serverSCD = "******"

objConnection.P rovider = "ADsDSOObje ct"
objConnection.O pen

strsql = "SELECT " & sel & " " & _
"FROM '" & serverSCD & "' " & _
"WHERE " & where & " "

objRecordset.Op en strsql, objConnection, , , adCmdText

End Sub
Apr 25 '12 #3
RhysW
70 New Member
hmm, is this the ONLY code related to searching and posting results? or are there more?, also which line is the COM exception coming from? (it tells you normally when debugging where the error comes from) this may help narrow it down
Apr 25 '12 #4
Senser
3 New Member
Yes this is the only code, some lines above i define the filter which i then give to the mysearcher. The COM Exception comes from the Message Box, if i comment it out it comes from the "foreach" line. The COM exception exactly says:"Das Zeitlimit für diese Anforderung wurde überschritten." which means The timelimit for this operation exceeded.
I've also captured this screenshot. http://imgur.com/kVSWp
this occurs if i click the plus while debugging after .findall(). there seems to be something wrong with the searchresultcol lection object, maybe the searchresultcol lection object only reffers to the server and has no data in it?
Apr 25 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1463
by: Rob R. Ainscough | last post by:
I have an interesting problem that is either a bug or just some local issue with my PC (probably the later). If I place my cursor on a word and hit F1 for help, it goes thru a process (see a message in the lower left corner saying Downloading...) and my hard disk churns away for a 2-4 seconds and then displays the "can't display this page" (standard explorer type message when a web site can't be found). Example
6
2012
by: John Baker | last post by:
Hi: Does "On Open" code execute before or after related data is loaded? I want to test before the form appears on the screen to see if there is any data in the queryresult, and if there is not then I want to close the form unseen by the end user. Regards John baker
2
1657
by: MS News | last post by:
Hello When I spawn a lightweight process on a new Thread and return immediately to the Client what happens if the lightweight process takes an hour to finish? Under what context is the process running Is it running under the current Session. How do I insure that It will run until it is completed Please point me to an artical
3
1235
by: Jim Heavey | last post by:
My session do not appear to be timing out. When I save something in ViewState, my expectation is that if no interaction occurs within the specified time, that the session variable would be null. Is that not the case? Here are the parameters in my webconfig file... <sessionState mode="InProc stateConnectionString="tcpip=127.0.0.1:42424 sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes cookieless="false" timeout="20" /
0
992
by: Amit | last post by:
Hi, My web.config looks like this: .... <authentication mode="Forms"> <forms name=".ASPXAUTH" protection="All" timeout="2"/> </authentication> .... <sessionState mode="InProc" cookieless="false" timeout='2'/> ....
4
1006
by: J M | last post by:
Hi, I have a huge problem in an app I'm writing. I use an OleDbDataset (and OleDbDataTable, and so on, created in the Component Designer) to add rows to a table. Three of the columns have Date/Time values. Column 1 is only a date (time: 0:00), no problem there. Columns 2&3 are only time (I struggled to extract only the time from a Date, who the hell came up with the idea of returning the TimeOfDay prop of a DateTime as a TimeSpan...
17
8629
by: Barret Bonden | last post by:
As an old programmer just now looking at VB.net I have a question: How does one simply open one form from another ? I don't mean how does one create a new instance of that form , but rather how to refer to THAT form ? And having done this, how does one get data to and from that form ? I have read the MS tutorial on this but it is senselessly complex; there must be a simple, straightforward method, or I can only assume that MS has...
2
2136
by: Brett | last post by:
If you paste the URL used in this code into a browser, it will render without errors. Running the code puts it in the Catch with a Time out error but not always. I have ran both (see link below also) links through Xenu with no errors. Any idea why the code produces errors? Dim statuscode As String Dim wReq As WebRequest = WebRequest.Create("") Dim StartTick As Int32 Try
2
3513
by: Jim M | last post by:
I rarely deal with recordsets directly with code, since I usually use Access queries, so be patient with this question. I want to open a recordset with various default variables used by my program. I tried: Public Sub OpenDefaults() Dim db As dao.Database Dim globalRst As dao.Recordset Set db = CurrentDb() Set globalRst = db.OpenRecordset("tblDefaults") End Sub
10
2155
by: tyagithehacker | last post by:
C is basically a non-object oriented language, then while doing system programming in UNIX why we have two different versions of OPEN function (system call): int open(const *pathname, int flags); int open(const *pathname, int flags, mode_t mode); which is basically a populer feature called Function Overloading of object oriented language only.
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10378
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10391
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.