SQLException

D

Dave

Hi,

I am trying to trap a SQLException erro in my Global.asax
file but I am unable to do it. In my Application_Error
code block I have a simple response.write followed by a
response.end but when a SQLException error (violation of
primary key) occurs this code does not execute, however it
does execute if I receive a Compiler error, is it not
possible to trap these types of exceptions globally?

Thanks in advance for any help with this

Dave
 
M

Marina

By the time application_error fires, the request is dead. You can't write
anything out or do a redirect or anything like that. This has nothing to do
with the fact that this is a SqlException.

Try handling Page_error in your page.
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top