PC Review


Reply
Thread Tools Rate Thread

Calling ExecuteReader more than once. How to Reset or Retry?

 
 
CSerpent
Guest
Posts: n/a
 
      31st Jul 2003
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PR_MESSAGE_CLASS is reset when calling Save() on item Tobias Böhm Microsoft Outlook Program Addins 4 30th Jul 2009 07:24 PM
Reset of radio button values without calling _Click() function MarkyB Microsoft Excel Programming 6 12th Feb 2008 08:54 AM
NullReferenceException when calling SqlCommand.ExecuteReader() yfujiki Microsoft Dot NET Compact Framework 7 28th Sep 2006 08:15 PM
calling soft reset from within your code. Ravi Microsoft Dot NET Compact Framework 1 4th Dec 2003 10:20 PM
"Internal connection fatal error" when calling SQLCommand.ExecuteReader Julian Bowes Microsoft ASP .NET 0 1st Jul 2003 11:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:16 PM.