shortcut catch exception

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?
 
H

Herfried K. Wagner [MVP]

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
///
 

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

Top