By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,211 Members | 2,227 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,211 IT Pros & Developers. It's quick & easy.

Timeout

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.