Try.. Catch....
From: Neelam Karne (NeelamKarne_at_hotmail.com)
Date: 09/17/04
- Next message: Kevin Spencer: "Re: Could not read key from registry"
- Previous message: Mark Fitzpatrick: "Re: just can't figure this out"
- Next in thread: Kevin Spencer: "Re: Try.. Catch...."
- Reply: Kevin Spencer: "Re: Try.. Catch...."
- Reply: John Timney \(Microsoft MVP\): "Re: Try.. Catch...."
- Reply: Steve C. Orr [MVP, MCSD]: "Re: Try.. Catch...."
- Reply: David Wier: "Re: Try.. Catch...."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 17 Sep 2004 11:01:25 -0700
I am using VB.Net with .Net Framework 1.1
Here is my code
Try
'Try my statements
Catch
'Catch my exception
Exit Sub
Finally
'Close my database connections...
What I noticed is when the program flow enters the Catch block, even though
there is an Exit Sub statement here, program still executes "Finally"
statement.
Here are my questions.
1.. There is no effect of exit statement here. Finally will be always
called when finally block statement exist.
2.. Finally block will be executed irrespective the catch block is
executed or not.
Is it correct? Any thoughts?
Neelam
- Next message: Kevin Spencer: "Re: Could not read key from registry"
- Previous message: Mark Fitzpatrick: "Re: just can't figure this out"
- Next in thread: Kevin Spencer: "Re: Try.. Catch...."
- Reply: Kevin Spencer: "Re: Try.. Catch...."
- Reply: John Timney \(Microsoft MVP\): "Re: Try.. Catch...."
- Reply: Steve C. Orr [MVP, MCSD]: "Re: Try.. Catch...."
- Reply: David Wier: "Re: Try.. Catch...."
- Messages sorted by: [ date ] [ thread ]