Err.Number in C#

  • Thread starter Thread starter Mr. X.
  • Start date Start date
M

Mr. X.

In VB.NET there was Err.Number.
I see there is no Err.Number in C# ?

Can I resolve It somehow ?

Thanks :)
 
In VB.NET there was Err.Number.
I see there is no Err.Number in C# ?

Can I resolve It somehow ?

Err.Number was a holdover from VB6. Like all VB6 holdovers, you were
strongly discouraged from using it. In C# you simply CANNOT use it. Just
write more try/catch blocks if you're really interested in where an error
takes place.
 
In VB.NET there was Err.Number.
I see there is no Err.Number in C# ?

Can I resolve It somehow ?

In VB6 there was Err.Number, in VB.NET you can still
use Err.Number but you really should use Try Catch,
in C# you have try catch.

So your conversion problems seem to be somewhat caused
by the fact that the current VB.NET is not properly
..NET'ified.

Arne
 
Err.Number was a holdover from VB6. Like all VB6 holdovers, you were
strongly discouraged from using it. In C# you simply CANNOT use it. Just
write more try/catch blocks if you're really interested in where an error
takes place.

Strictly speaking:

using Microsoft.VisualBasic;

and:

Information.Err().Number

does work in C#, but there a no point in it, because
one will need to catch the exceptions explicitly and
save the exception to make it available, so it is
less code to do it the C# way.

Arne
 
Back
Top