Re: two threads
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 18 Nov 2008 11:04:58 -0500
Well, in order to do this, you will have to send some piece of information back to the user that will allow the user to identify which stored proc that she wants to check up on. When your thread is done, you would place information in the Session collection (or some other collection which is accessible to the user) keyed on the value indicated above to indicate that the process is complete.
However, even if you run this on a separate thread, it's not going to work. The reason for this is that you are getting a SqlException, which indicates that the command is timing out. Just running this on another thread will cause the exception to be thrown on that other thread.
Rather, you should set the CommandTimeout property on the SqlCommand you are executing to a value that will be reasonable for the operation you are performing.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"polilop" <filip.matosicSKINIovo@@st.htnet.hr> wrote in message news:0AEBBFCF-35F3-4242-B512-70A32EA77E86@xxxxxxxxxxxxxxxx
I have a stored procedure in my web application that goes on for long time,
which couses IE to :
[SqlException (0x80131904): Timeout expired. The timeout period elapsed
prior to completion of the operation or the server is not responding.]
So i thought to enable the user to run the stored procedure in a background
thread (which will fill a temporary table with data), return the http
response,
which tells the user the program started. Then the user can check if the
program has finished by checking the thread.
What i need to know is how can i run a seperate thread, return http
response (postback) to the user, and allso how to check if the thread is
still running from a second/another http reqest ?
.
- Follow-Ups:
- Re: two threads
- From: polilop
- Re: two threads
- References:
- two threads
- From: polilop
- two threads
- Prev by Date: Deployment/Custom Action/Shortcut triggers install
- Next by Date: Re: Windows.Forms.Timer does not fire
- Previous by thread: two threads
- Next by thread: Re: two threads
- Index(es):
Relevant Pages
|