Help with timeout

G

Guest

Hi,
When I call one of my sp from my asp.net app I get the foll error

Server Error in '/center' Application
--------------------------------------------------------------------------------

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The
timeout period elapsed prior to completion of the operation or the server is
not responding.

Source Error:

Line 16: Dim dsStores As DataSet =
SqlHelper.ExecuteDataset(sConnectionString, CommandType.StoredProcedure, _
Line 17: "StOrders", New
SqlParameter("@eName", sProductName), _
Line 18: New
SqlParameter("@dateFrom", sDateFrom))

The SP works with certain products. I get the timeout on products that have
a hugh amount of data in the database. If I execute the SP from the Query
Analyzer for products I get the error for it takes 1min 15 sec average. Any
ideas on how to increase the timeout time. I am using the MS Data Access
Application Block.

Thanks
 
M

Miha Markic [MVP C#]

Hi Chris,

If you have access to command class instance then you should set
CommandTimeout to a value that suits you.
See also if there is an overload that takes such parameter.
Other solution would be to manually create the command class instance and do
the operation by yourself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top