Dim conn_state as string
conn_state = Myconnection.State
Label1.Text = conn_state
'Valid values of ConnectionState are Closed, Connecting,
'Open, Executing, Fetching, and Broken.
If (cn.State And ConnectionState.Open) <> 0 Then
cn.Close
End If