Hi. I have the following method, which is supposed to set up my
DataReader for reading. Since my network connection might not be
active the first time around, I have placed the ExecuteReader() call
in a loop. However, if the call fails once (it times out and raises
an exception), I noticed that it doesn't even try the second time
around. Instead, I get an immediate exception. How do I clear out
the Connection or the command object, or the error state, such that I
can try again? Thanks!! -Geoff
Private Sub ReadCFGMove()
Dim OperationCompleted As Boolean
Cursor.Current = Cursors.WaitCursor
OperationCompleted = False
While Not OperationCompleted
Try
DataReader = qryCfgMove_SelectAll.ExecuteReader()
OperationCompleted = True
Catch
System.Threading.Thread.CurrentThread.Sleep(SLEEP_DURATION)
End Try
End While
Cursor.Current = Cursors.Default
End Sub
|