Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 ?

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...