Page 4 of 4

Re: Report compilation error - How to prevent CS file deleti

Posted: Tue Jan 28, 2014 1:00 pm
by kgb2013
Hello.

What is wrong with it ?
When I use the SQL Profiler to see the infinite queries being sent to the DB, the SQL query seems OK.
SQL Server executes them with no problem.
Am I mising something?

EDIT:
I have also tried changing "string.IsNullOrWhiteSpace" to "string.IsNullOrEmpty" (that you once suggested for me for some reason) but it didn't help.

Re: Report compilation error - How to prevent CS file deleti

Posted: Tue Jan 28, 2014 1:16 pm
by Alex K.
Hello,

Sorry, I have not noticed that you call Connect() method for datasource in BeforePrint event of Page. You should connect only once, but in your report this occurs many times and caused a looping.

Please try to add the additional variable which will be indicate that datasource is already connected.

Thank you.

Re: Report compilation error - How to prevent CS file deleti

Posted: Tue Jan 28, 2014 1:21 pm
by kgb2013
Thanks.

How can I do this?
Is this OK (if I put it on BeforePrint)? :

Code: Select all

if(!Ekkrem.IsConnected) Ekkrem.Connect();
(Now that I've tried it, it seems to prevent the problem.)

Re: Report compilation error - How to prevent CS file deleti

Posted: Tue Jan 28, 2014 1:26 pm
by Alex K.
Hello,

In previous post i attach the modified report in which have added an additional boolean variable and use it in BeforePrint event.
Your code also should work.

Thank you.

Re: Report compilation error - How to prevent CS file deleti

Posted: Tue Jan 28, 2014 1:28 pm
by kgb2013
Thanks.
But, could my solution (check for `Ekkrem.IsConnected`) do the same thing?
It seems simpler too.

Re: Report compilation error - How to prevent CS file deleti

Posted: Tue Jan 28, 2014 1:32 pm
by Alex K.
Hello,

Yes.
Let us know if you need any additional help.

Re: Report compilation error - How to prevent CS file deleti

Posted: Tue Jan 28, 2014 1:33 pm
by kgb2013
OK.
Thanks a lot! :)

Re: Report compilation error - How to prevent CS file deleti

Posted: Tue Jan 28, 2014 1:40 pm
by Alex K.
We are always glad to help you!