ultraman Posted October 8, 2003 Posted October 8, 2003 Hi everyone ! I'm trying to catch a particular type of exception here, so basically I have a multiple catch block that catches OverflowException or else, any other exceptions. Try cmd.ExecuteNonQuery() Catch ofEx As OverflowException lblError.Text = "Overflow" lblError.Visible = True Catch ex As SqlException lblError.Text = "Any exception" lblError.Visible = True End Try The only problem is : it doesn't catch the overflow exception as it's supposed to, but rather sees it as a SqlException. Anyone knows what's wrong ? Quote Now go on, boy, and pay attention. Because if you do, someday, you may achieve something that we Simpsons have dreamed about for generations: You may outsmart someone! --Homer Simpson
*Gurus* Derek Stone Posted October 8, 2003 *Gurus* Posted October 8, 2003 All errors generated by SQL Server will result in SqlException being thrown. You can query the SqlException.Errors collection and the SqlException.Number property for more details as to what caused the exception. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.