View Single Post
  #3 (permalink)  
Old 10-01-2007, 08:10 AM
ccoonen ccoonen is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jun 2007
Location: Wisconsin
Posts: 317
iTrader: (0)
ccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished road
Also works for other loops - like if you wanted to be optimized you could do
Code:
For Each DR as DataRow in DataTable
  If DR.ProductID = 34
    MsgBox(DR.ProductName)
    Exit For
  End If
Next
This woulid exit out of the for and save all yoru cpu cycles

Last edited by TeraTask : 12-24-2007 at 07:45 PM. Reason: Added code tags
Reply With Quote