W
Woody Splawn
I have a try catch statement in a fucntion that is supposed to return a true
or a false
My code looks like this:
Try
mySqlConnection.Open()
Dim Da1 As New SqlDataAdapter("Select JnlType, Description from
JnlType", mySqlConnection)
Dim Ds As New DataSet("X")
Da1.Fill(Ds)
Catch
MsgBox("There was a problem filling the Dataset for Lookup table
for JnlType")
Return False
Finally
If mySqlConnection.State = ConnectionState.Open Then
mySqlConnection.Close()
End If
End Try
My question is this: Is the Try Catch code smart enough to run the Finally
statment after the MsgBox and then return false or do I need to write the
code some other way. This is what I want it to do but I am not sure I have
it written correctly.
or a false
My code looks like this:
Try
mySqlConnection.Open()
Dim Da1 As New SqlDataAdapter("Select JnlType, Description from
JnlType", mySqlConnection)
Dim Ds As New DataSet("X")
Da1.Fill(Ds)
Catch
MsgBox("There was a problem filling the Dataset for Lookup table
for JnlType")
Return False
Finally
If mySqlConnection.State = ConnectionState.Open Then
mySqlConnection.Close()
End If
End Try
My question is this: Is the Try Catch code smart enough to run the Finally
statment after the MsgBox and then return false or do I need to write the
code some other way. This is what I want it to do but I am not sure I have
it written correctly.