Click here to Skip to main content
15,888,260 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to run stored procedure in background using asp.net sql server 2005? Without using thread?
Posted
Updated 22-Jul-13 2:47am
v2
Comments
Jameel VM 22-Jul-13 8:40am    
Please elaborate the question
Joezer BH 22-Jul-13 8:47am    
That makes no sense at all.
"without using thread" - where is it that you wish to avoid the thread?
vinay.tatipamula 22-Jul-13 8:48am    
Visit http://quartznet.sourceforge.net/. you can run your program(stored procedure) in the background using asp.net.
[no name] 22-Jul-13 9:03am    
At a guess, I would say that you would probably do this the same exact way that you have already been told and you accepted the solution.

Hello Santosh,

Please have a look at following two articles.

Regards,
 
Share this answer
 
v2
You can't, in practice. If you don't use a thread (be it a Thread class or a BackgroundWorker class) then your code will run on your existing (i.e. main, or UI) thread. Since all the ExecuteXXX methods are blocking, they will all wait until the SQL query is complete before they return control to the next instruction in your app.

In theory, you could do it with BeginExectuteNonQuery and EndExecuteNonQuery which will allows asynchronous operation, but since there is no progress reporting involved in these, and EndExecuteNonQuery is a blocking operation, unless you can predict the execution time of the SQL query exactly under all possible circumstances, it is not practical to use these instead of a thread - in conjunction with a thread is how they are expected to be used.
 
Share this answer
 
Comments
ZurdoDev 23-Jul-13 9:50am    
He reasked this and I suggested using jquery's ajax method. That will cause it to run "in the background" as far as the user is concerned.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900