Working with Visual Basic .NET's Looping Control Structures

Looping control structures allow for a set of instructions to be executed a repeated number of times. The number of times the code is repeated can be a fixed number of times, such as with For ... Next loops, or repeated until some condition is met, such as with Do ... Loop loops.

In the next three sections, we'll be looking at two of Visual Basic .NET's looping constructs: For ... Next loops and Do ... Loop loops. These two constructs are, at a high-level, equivalent, though they have differing syntax. That is, they accomplish essentially the same task—repeating a set of instructions a certain number of times. In fact, either one of the two looping structures we'll be examining can be ...

Get SAMS Teach Yourself ASP.NET in 24 Hours now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.