On Error tranlation

  • Thread starter Thread starter tiger79
  • Start date Start date
T

tiger79

Hello,
I'd like to know what the C# counterpart is for the VB On Error statement ?
My VB code looks like this :

On Error GoTo ErrGetItem

plain simple ud say, but I need to "translate" it into C#...
Any ideas ???
 
try
{
// do your work here
// this is the code after the On Error Goto XXX statement
}
catch (Exception ex)
{
// execution flow comes here if an error has occured
// this is the same as the code after the label referred to
// by the On Error Goto XXX bit.
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top