Solved

Processing your request... SQL Timeout

Posted on 2004-04-22
8
194 Views
Last Modified: 2012-05-04
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.SqlException: 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.
0
Comment
Question by:deno2
  • 3
  • 2
8 Comments
 
LVL 28

Expert Comment

by:mmarinov
ID: 10886508
for displaing message you can use this scenario
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
0
 

Author Comment

by:deno2
ID: 10886574
I've tried that but now my code won't compile.

I get:

C:\Inetpub\wwwroot\e\Components\Comparisons.cs(26): Property or indexer 'System.Data.SqlClient.SqlConnection.ConnectionTimeout' cannot be assigned to -- it is read only
0
 
LVL 28

Assisted Solution

by:mmarinov
mmarinov earned 125 total points
ID: 10886620
:( sorry it was property of the sqlcommnad not of sqlconnection

B..M
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:deno2
ID: 10886732
I did:

// set timeout
myCommand.SelectCommand.CommandTimeout = 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.
0
 
LVL 28

Expert Comment

by:mmarinov
ID: 10887092
0
 
LVL 21

Accepted Solution

by:
tovvenki earned 125 total points
ID: 10887537
Hi have look at this url
http://www.kbalertz.com/Feedback_837375.aspx

for displaying the "Please wait we are processing your request..." message while the query is getting processed.

Hope that this helps you.

Regards,
venki
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
daypilot scheduler 3 36
Save ms data to server side. 19 56
Object Oriented Programming, C#, referencing, scoping. 13 69
insert value of checklistbox checked 4 32
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question