Timeout

G

Guest

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?
 
M

Marina

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 said:
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?
 
G

Guest

Marina

Thank you so much. That did it! And thank you for the explanation of the different timeout properties.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top