469,623 Members | 1,136 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Timeout

Hello

I have a SQL Server 2000 database query that takes a long time (about 1.5 min in SQL Query Analyser) that I am running from a web page. I keep getting a Timeout error regardless of how long I set the Timeout property i

Server.ScriptTimeout = 5000

in the asp.net page o

Connect Timeout=500

in the DB conn string. I still get a System.Data.SqlClient.SqlException error from asp.net

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not respondin

The server is there because the same conn string is used in other queries that work. What is the problem?
Nov 18 '05 #1
2 2116
ScriptTimeout is the timeout for the asp.net page - meaning how long it has
to be working for before it times out. Unrelated to database timeouts.

The connect timeout in the connection string, is how long you should try to
connect for, before giving up if not able to connect.

Again, unrelated to actually running a query - just talking about the
timeout to connect to the database (hence, connecttimeout).

You need to set the CommandTimeout property of the SqlCommand object - this
is the timeout that defines how long a query can run before it is deemed a
problem.

"Solel Software" <in**@solelsoftware.com> wrote in message
news:AB**********************************@microsof t.com...
Hello,

I have a SQL Server 2000 database query that takes a long time (about 1.5 min in SQL Query Analyser) that I am running from a web page. I keep
getting a Timeout error regardless of how long I set the Timeout property in
Server.ScriptTimeout = 5000;

in the asp.net page or

Connect Timeout=5000

in the DB conn string. I still get a System.Data.SqlClient.SqlException error from asp.net:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
The server is there because the same conn string is used in other queries

that work. What is the problem?
Nov 18 '05 #2
Marina

Thank you so much. That did it! And thank you for the explanation of the different timeout properties.
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by E Sullivan | last post: by
12 posts views Thread by Geigho | last post: by
2 posts views Thread by Greg Decos | last post: by
4 posts views Thread by DavidS | last post: by
17 posts views Thread by jensen bredal | last post: by
22 posts views Thread by Nick Craig-Wood | last post: by
25 posts views Thread by =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post: by
2 posts views Thread by JimLad | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.