Nested exceptions example

  • Thread starter Thread starter Chris Leffer
  • Start date Start date
C

Chris Leffer

Could anyone shows me a simple example of nested exceptions handling on
vb.net? Or any articles that explains this concept, since I am getting
difficulties to see when/how to use nested exceptions.

Regards,
Chris Leffer
 
Try
' open SQL connection here...
' execute stored proc

Try '<-- nested try block
' open file here
' write data to file
Catch Ex As Exception
' catch & handle any errors during file writing operation
Finally
' close file
End Try

Catch sqlEx as SqlException
' handle database errors
Catch Ex As Exception
' handle unexpected errors
Finally
' close SQL stuff
End Try
 
Back
Top