C
Curious
My "Monitor" program has about 15 seconds of delay on a single user's
computer. However, there're no deplay on other users' computers. I've
found that the delay on her computer happens in the line of code
below:
// Loop
foreach (ReportFile lFile in aReport.Files) \\15 seconds
of delay
{
\\blah blah blah
}
I see that it calls numerous methods (including a stored procedure) in
order to get "aReport.Files". I suspect that for the only computer
that has the delay issue, each time when looping "foreach (ReportFile
lFile in aReport.Files)", it calls the numerous methods to get
"aReport.Files" and that's the reason for the extended period of
deplay.
However, I don't have any proof that this is the case on her computer,
since I don't have the deplay issue in my debugger on my computer. In
my debugger, it only executes "aReport.Files" once.
I was thinking of changing this part of the code to below in order to
prevent "aReport.Files" being called multiple times:
ReportFileCollection rptFiles = aReport.Files;
// Loop
foreach (ReportFile lFile in rptFiles )
{
\\blah blah blah
}
Will this solve the delay issue on the user's computer? Thanks!
computer. However, there're no deplay on other users' computers. I've
found that the delay on her computer happens in the line of code
below:
// Loop
foreach (ReportFile lFile in aReport.Files) \\15 seconds
of delay
{
\\blah blah blah
}
I see that it calls numerous methods (including a stored procedure) in
order to get "aReport.Files". I suspect that for the only computer
that has the delay issue, each time when looping "foreach (ReportFile
lFile in aReport.Files)", it calls the numerous methods to get
"aReport.Files" and that's the reason for the extended period of
deplay.
However, I don't have any proof that this is the case on her computer,
since I don't have the deplay issue in my debugger on my computer. In
my debugger, it only executes "aReport.Files" once.
I was thinking of changing this part of the code to below in order to
prevent "aReport.Files" being called multiple times:
ReportFileCollection rptFiles = aReport.Files;
// Loop
foreach (ReportFile lFile in rptFiles )
{
\\blah blah blah
}
Will this solve the delay issue on the user's computer? Thanks!