Optimizing crystal report
-
hi all i am having a stored procedure in my database which will take 2 parameters and return a resultset which i want to display in a crystal report.when i am executing the store proc. alone with the paramaters in the query analyser of sql server 2000,it is taking around 2.5 min.but when i pass the parameters from a vb.net page page,it z showing an error:{"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."} please help me out to solve this problm.. thanks in advance
i am Pradip Kishore
-
hi all i am having a stored procedure in my database which will take 2 parameters and return a resultset which i want to display in a crystal report.when i am executing the store proc. alone with the paramaters in the query analyser of sql server 2000,it is taking around 2.5 min.but when i pass the parameters from a vb.net page page,it z showing an error:{"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."} please help me out to solve this problm.. thanks in advance
i am Pradip Kishore
-
hi all i am having a stored procedure in my database which will take 2 parameters and return a resultset which i want to display in a crystal report.when i am executing the store proc. alone with the paramaters in the query analyser of sql server 2000,it is taking around 2.5 min.but when i pass the parameters from a vb.net page page,it z showing an error:{"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."} please help me out to solve this problm.. thanks in advance
i am Pradip Kishore
Have you looked at optimizing the stored procedure?
-
hi all i am having a stored procedure in my database which will take 2 parameters and return a resultset which i want to display in a crystal report.when i am executing the store proc. alone with the paramaters in the query analyser of sql server 2000,it is taking around 2.5 min.but when i pass the parameters from a vb.net page page,it z showing an error:{"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."} please help me out to solve this problm.. thanks in advance
i am Pradip Kishore
Pradip Kishore wrote:
but when i pass the parameters from a vb.net page page,it z showing an error:{"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."}
The default CommandTimeout for an SqlCommand object is 30 seconds. If your query doesn't return a result set in that time, you get this error. Either you have to optimize the stored procedure and/or table structures (indexes!), and/or up the timeout in the SqlCommand object. If it's taking 2.5 minutes to return a set, are you sure that this is as fast as your query can execute?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Have you looked at optimizing the stored procedure?
hi thanks for your response IS there any way to optimize a stored procedure for quick data retrival.. please help me thanks in advance..
i m pradip kishore
-
Pradip Kishore wrote:
but when i pass the parameters from a vb.net page page,it z showing an error:{"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."}
The default CommandTimeout for an SqlCommand object is 30 seconds. If your query doesn't return a result set in that time, you get this error. Either you have to optimize the stored procedure and/or table structures (indexes!), and/or up the timeout in the SqlCommand object. If it's taking 2.5 minutes to return a set, are you sure that this is as fast as your query can execute?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Hi thanks for your response.. but can you show me some sample code or any links by which i can be able to do this..? thanks in advance..
pradip kishore
-
hi thanks for your response IS there any way to optimize a stored procedure for quick data retrival.. please help me thanks in advance..
i m pradip kishore
Pradip Kishore wrote:
IS there any way to optimize a stored procedure for quick data retrival..
In short, you need to look at where bottlenecks are. Without having any idea how your database is set up, I can't really help. Any queries you have in the stored proc, analyze it through query analyzer... Paul
-
Hi thanks for your response.. but can you show me some sample code or any links by which i can be able to do this..? thanks in advance..
pradip kishore
I already gave it to you. The
CommandTimeout
property of your SqlCommand objects you created! As far as optimization goes. That's done with experience and trial and error. There is no code that will just "do it for you". You have to understand precisely how SQL Server works, how Indexes work and why. What are the consequences of using them and overusing them. And on and on and on...A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007