How do you interupt a long-running database query?

G

Gershon

I have an ASP.NET/C# web application running against a SQL Server
database using ADO.NET. Whenever there is a long-running database
query, the web application hangs until the database query is complete.
Even clicking the browser's stop button and clicking on other links
within the web application fails. The only thing the user can do is
close the browser and open up a new browser window. Is there any other
way for a user to interupt a database query?
I am not using a Dispose method and thought that might be the
problem. However, there is no "unmanaged" code being used that I am
aware of.
 
K

Kevin Spencer

You might try having the database operation happen in a new Thread.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
M

Max

I believe you can set the timeout smaller and abort using a try/catch...
which you should be doing anyway whenever you make a database call. I'm new
to ASP.NET however. ;)

Also, I'd be concerned about the database hanging like that. Is there a lot
of network traffic? Optimize your SQL Server? I'm afraid to ask, but you ARE
using stored procedures for all your queries I hope. ;)

-Max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top