W
Woody Splawn
In a message yesterday titled Try Catch Question I got numerous responses.
Thank you to all. After all the smoke clears I guess the question is where
to place the Return True statement in the block of code below that is part
of a function. Should it be at the end of the try block, as dipicted below,
or should it be after the End Try Block? Or does it make a difference?
Try
mySqlConnection.Open()
Dim Da1 As New SqlDataAdapter("Select JnlType, Description from
JnlType", mySqlConnection)
Dim Ds As New DataSet("X")
Da1.Fill(Ds)
Return True
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
Thank you to all. After all the smoke clears I guess the question is where
to place the Return True statement in the block of code below that is part
of a function. Should it be at the end of the try block, as dipicted below,
or should it be after the End Try Block? Or does it make a difference?
Try
mySqlConnection.Open()
Dim Da1 As New SqlDataAdapter("Select JnlType, Description from
JnlType", mySqlConnection)
Dim Ds As New DataSet("X")
Da1.Fill(Ds)
Return True
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