there may be a situation when you need to execute a block of code several number of times. in general, statements are executed sequentially: the first statement in a function is executed first, followed by the second, and so on.
programming languages provide various control structures that allow for more complicated execution paths.
a loop statement allows us to execute a statement or group of statements multiple times and following is the general form of a loop statement in most of the programming languages −

vb.net provides following types of loops to handle looping requirements. click the following links to check their details.
loop type | description |
---|---|
it repeats the enclosed block of statements while a boolean condition is true or until the condition becomes true. it could be terminated at any time with the exit do statement. |
|
it repeats a group of statements a specified number of times and a loop index counts the number of loop iterations as the loop executes. |
|
it repeats a group of statements for each element in a collection. this loop is used for accessing and manipulating all elements in an array or a vb.net collection. | |
it executes a series of statements as long as a given condition is true. |
|
it is not exactly a looping construct. it executes a series of statements that repeatedly refer to a single object or structure. |
|
you can use one or more loops inside any another while, for or do loop. |
loop control statements
loop control statements change execution from its normal sequence. when execution leaves a scope, all automatic objects that were created in that scope are destroyed.
vb.net provides the following control statements. click the following links to check their details.
control statement | description |
---|---|
terminates the loop or select case statement and transfers execution to the statement immediately following the loop or select case. |
|
causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating. |
|
transfers control to the labeled statement. though it is not advised to use goto statement in your program. |