Permalink
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (62 sloc) 2.94 KB
title ms.date ms.prod ms.reviewer ms.suite ms.technology ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author translation.priority.ht translation.priority.mt
Skip Clause (Visual Basic)
2015-07-20
.net
devlang-visual-basic
article
vb.QuerySkip
VB
queries [Visual Basic], Skip
Skip statement
Skip clause
f00eb172-3907-4c43-9745-d8546ab86234
17
dotnet-bot
dotnetcontent
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
ru-ru
zh-cn
zh-tw
cs-cz
pl-pl
pt-br
tr-tr

Skip Clause (Visual Basic)

Bypasses a specified number of elements in a collection and then returns the remaining elements.

Syntax

Skip count  

Parts

count
Required. A value or an expression that evaluates to the number of elements of the sequence to skip.

Remarks

The Skip clause causes a query to bypass elements at the beginning of a results list and return the remaining elements. The number of elements to skip is identified by the count parameter.

You can use the Skip clause with the Take clause to return a range of data from any segment of a query. To do this, pass the index of the first element of the range to the Skip clause and the size of the range to the Take clause.

When you use the Skip clause in a query, you may also need to ensure that the results are returned in an order that will enable the Skip clause to bypass the intended results. For more information about ordering query results, see Order By Clause.

You can use the SkipWhile clause to specify that only certain elements are ignored, depending on a supplied condition.

Example

The following code example uses the Skip clause together with the Take clause to return data from a query in pages. The GetCustomers function uses the Skip clause to bypass the customers in the list until the supplied starting index value, and uses the Take clause to return a page of customers starting from that index value.

[!code-vbVbSimpleQuerySamples#1]

See Also

Introduction to LINQ in Visual Basic
Queries
Select Clause
From Clause
Order By Clause
Skip While Clause
Take Clause