|
-
October 18th, 2002, 08:20 PM
#1
Timeout expired
I tried to call a stored procedure in SQL server, and it returned "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
". The source error is at:
myReader = aCommand.ExecuteReader();
The SP works on a SQL Query Analyzer, but takes more than 2 minutes. Some other SPs which take less time all work well in my ASP.Net application. Is there any parameter that I should set to lengthen the timeout time? I tried the connectionstring, but it doesn't work.
-
October 20th, 2002, 05:04 AM
#2
use Connect timeout property.
For ex:
The connection string would be like the following string:
strCnn="server =local;database=pubs;uid=sa;pwd=;
connect timeout=60"
Seshu
Thanks
seshu kumar g
-
March 11th, 2003, 11:46 AM
#3
Ignoring the timeout.
I am having the same problem. However I have changed the timeout property of the connection string with no change. I run the same query in SQL Query Analyzer and it takes about 45 seconds, yet if I set the time out to 60 or even 240. I still don't get any response.
Also, I set the timeout to 1 and I run queries that I know will return results and they still work, even though they take 20 seconds to run.
So my question is;
Is the timeout property even used???
DG
-
March 11th, 2003, 12:22 PM
#4
Answer...
Here is what solved my problem.
I set the connection timeout, but I was not setting the command timeout.
So if you have this problem be sure to set it as below:
Code:
sqlCommand1.CommandTimeout = 60
Very simple...
-
May 2nd, 2003, 05:37 PM
#5
Hey guys, u saved my day too... But i don't understand this, why don't I have to set this property at all places. I have other queries running for more time than this as well.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|