Solved

Processing your request... SQL Timeout

Posted on 2004-04-22
8
195 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
c#, datatable, aspx 4 51
Web page design problem 3 41
Need to find a web event on the IIS server 4 54
asp.net mvc5 6 33
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 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