shortcut catch exception

  • Thread starter Thread starter Cc
  • Start date Start date
C

Cc

hi,
is there a shortcut way of writting catch multi exception becase it causing
me to repeat coding.
for example

try

catch e as odbcexception
'the code here are same
catch e as InvalidOperationException
'the code here are same
end catch

is there posible of writing to merge both exception into 1?
 
Hello,

Cc said:
is there a shortcut way of writting catch multi exception becase
it causing me to repeat coding.
for example

try

catch e as odbcexception
'the code here are same
catch e as InvalidOperationException
'the code here are same
end catch

is there posible of writing to merge both exception into 1?

Try...Catch...Finally Statements (Visual Basic Language Reference)
http://msdn.microsoft.com/library/en-us/vblr7/html/vastmTryCatchFinally.asp

=> No.

\\\
Try
...
Catch e As Exception
If _
TypeOf e Is OdbcException Or _
TypeOf e Is InvalidOperationException _
Then
...
Else
...
End If
End Try
///
 
Back
Top