K
Karl Seguin [MVP]
Your error handling isn't very good...you are CATCHING the error but not
HANDLING it...instead you are swallowing any possible error.
90% of the time you can't really handle an error, all you can do is clean up
after yourself, that's why the using keyword exists. The proper way to do
this is:
using (connection...){
using(command){
using (datareader{
execute
}
}
}
and then in your global.asax's OnError, catch any unhandled error, log it
(if desired) and display a frienly error message.
Karl
HANDLING it...instead you are swallowing any possible error.
90% of the time you can't really handle an error, all you can do is clean up
after yourself, that's why the using keyword exists. The proper way to do
this is:
using (connection...){
using(command){
using (datareader{
execute
}
}
}
and then in your global.asax's OnError, catch any unhandled error, log it
(if desired) and display a frienly error message.
Karl