VB6:
VB Code:
  1. Dim objConn As Connection
  2. On Error Goto ErrHandler:
  3.  
  4.    'code
  5.  
  6.    Exit Sub
  7. ErrHandler:
  8.    If Not (objConn Is Nothing) Then
  9.       objConn.Close
  10.       Set objConn = Nothing
  11.    End If
  12.    Err.Raise Err.Number, Err.Source, Err.Description

VB.NET
VB Code:
  1. Dim Conn As SQLConnection
  2.    Try
  3.  
  4.       'code
  5.  
  6.    Catch Ex As Exception
  7.       If Not (Conn Is Nothing) Then
  8.          Conn.Close
  9.          Conn = Nothing
  10.       End If
  11.  
  12.       'Want to raise exception to UI here
  13.  
  14.    End Try
How do I do this?

Woka