Solved

Processing your request... SQL Timeout

Posted on 2004-04-22
8
192 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
A short film showing how OnPage and Connectwise integration works.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

943 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

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now