Solved

Processing your request... SQL Timeout

Posted on 2004-04-22
8
191 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
Comment Utility
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
Comment Utility
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
Comment Utility
:( sorry it was property of the sqlcommnad not of sqlconnection

B..M
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:deno2
Comment Utility
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
Comment Utility
0
 
LVL 21

Accepted Solution

by:
tovvenki earned 125 total points
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

10 Experts available now in Live!

Get 1:1 Help Now