Dear Friends ,
I have a nested loop of Do Loop in vb.Net
Like
Do
Do
'Contunue Do 'Main Loop
Loop
Loop
In Do Loop i want to go to next record from main do loop any one can tell me about this please avoid GoTo Statement
COntinue From Main Loop
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Jignesh TrivediRank #16 · 50.3K reputationPosted Jun 27, 2012, 11:29 PM EDT
Try with Exit While or Exit Do.
please refer
http://msdn.microsoft.com/en-us/library/t2at9t47%28v=vs.80%29.aspx
http://msdn.microsoft.com/en-us/library/zh1f56zs.aspx
Dim number As Integer = 8
Do Until number = 10
If number <= 0 Then Exit Do
number -= 1
counter += 1
Loop
hope this will help you.
VulpesRank #55 · 29.2K reputationPosted Jun 28, 2012, 12:23 AM EDT
Dim continueMain As Boolean = False;
Do
Do
continueMain = True
Exit Do
Loop
If continueMain Then Exit Do
Loop
or this is perhaps a bit more elegant:
Do
While True
Exit Do
End While
Loop