TheVampire
Programmer
Why would a try / catch block work sometimes, and other times just stop the app ( in debug mode ) without generating an error?
In the code below, I try to find the highest number in a specific column. Sometimes the table is not ready to be opened, so I will get an error and have to wait and try again.
Sometimes, but not all of the time, when I get to the fill command, the execution will just halt, without throwing an error OR stepping into the catch code.
Any ideas? My debugger is set to break on all user unhandled exceptions.
In the code below, I try to find the highest number in a specific column. Sometimes the table is not ready to be opened, so I will get an error and have to wait and try again.
Sometimes, but not all of the time, when I get to the fill command, the execution will just halt, without throwing an error OR stepping into the catch code.
Any ideas? My debugger is set to break on all user unhandled exceptions.
Code:
Try
Dim MyData As New DataTable
Dim da As New System.Data.OleDb.OleDbDataAdapter("SELECT MAX (UniqueID) as [HighestID] from logbase", LDB)
da.Fill(MyData)
MyHighestID = MyData.Rows(0).Item(0).ToString
Catch
'Code here to handle error
End Try