deno2
asked on
Processing your request... SQL Timeout
Hi,
I have an asp.net page that runs a stored procedure on SQL Server 2000. The trouble is that the query can take over a minute to run and I get the following exception:
"System.Data.SqlClient.Sql Exception: Timeout expired."
What I want to know is:
- How do I display a "Please wait we are processing your request..." notice while the query is running.
and
- How do I increase the timeout from the 30 second default.
I have tried but without success.
I have an asp.net page that runs a stored procedure on SQL Server 2000. The trouble is that the query can take over a minute to run and I get the following exception:
"System.Data.SqlClient.Sql
What I want to know is:
- How do I display a "Please wait we are processing your request..." notice while the query is running.
and
- How do I increase the timeout from the 30 second default.
I have tried but without success.
ASKER
I've tried that but now my code won't compile.
I get:
C:\Inetpub\wwwroot\e\Compo nents\Comp arisons.cs (26): Property or indexer 'System.Data.SqlClient.Sql Connection .Connectio nTimeout' cannot be assigned to -- it is read only
I get:
C:\Inetpub\wwwroot\e\Compo
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I did:
// set timeout
myCommand.SelectCommand.Co mmandTimeo ut = 1200;
and it worked fine. Thanks for the help with that - it's been bugging me for ages.
I'm still having trouble with:
Label.Text = "Please wait we are processing your request...";
Response.Flush();
It's as if the response.flush part is not doing it's job. The message is not displayed until the query has finished.
Ideally, this is what I want to happen.
- User clicks button on form.
- Screen clears and message is displayed.
- Query runs.
- Query Finishes.
- Message is removed.
- Form and Results are displayed.
// set timeout
myCommand.SelectCommand.Co
and it worked fine. Thanks for the help with that - it's been bugging me for ages.
I'm still having trouble with:
Label.Text = "Please wait we are processing your request...";
Response.Flush();
It's as if the response.flush part is not doing it's job. The message is not displayed until the query has finished.
Ideally, this is what I want to happen.
- User clicks button on form.
- Screen clears and message is displayed.
- Query runs.
- Query Finishes.
- Message is removed.
- Form and Results are displayed.
ok
i found this
http://www.ozoneasylum.com/21445 - the last posting
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=6333&lngWId=4
HTH
B..M
i found this
http://www.ozoneasylum.com/21445 - the last posting
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=6333&lngWId=4
HTH
B..M
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Label.Text = "Please wait we are processing your request...";
Response.Flush()
call the stored procedure
to increase the timeout
you have to use
SqlConnection con = new SqlConnection();
con.ConnectionTimeout = 1200; //for example
HTH
B..M