help in try catch finally...

i am new to .net and i want to know about
the new exception handling. try,catch,finally!
what is the equivalent of the old "on error resume next",
"on error resume" here in .net? i really need help on this
one. thanks

Comments

  • : i am new to .net and i want to know about
    : the new exception handling. try,catch,finally!
    : what is the equivalent of the old "on error resume next",
    : "on error resume" here in .net? i really need help on this
    : one. thanks
    :

    Equivalent of old "On Error Resume Next" is:

    [code]
    Try
    'Some code here
    Catch
    End Try
    [/code]

    Hope this helps!
  • A little more detail...


    [code]
    Try
    'Some code here
    Catch ex as
    'specific handling for this type of exception
    Catch ex as
    'same thing
    Catch ex as Exception
    'Any exception that didnt meet prior catches
    Finally
    ' release locks , network, db conneciton other things that must
    ' be release manually
    End Try
    [/code]
  • ok. how about the "on error resume"?


  • Well what are you trying to accomplish with your error handling? 'On Error Resume Next' allowed a runtime error to return to where the function it occured in was called without stopping the whole app. Since you can catch the error in the funciton this is still accomplished. You can also manually 'Throw' exceptions.
    ~rlc
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories