InternetUnicodeHTMLCSSScalable Vector Graphics (SVG)Extensible Markup Language (xml) ASP.Net TOCASP.NetMiscellaneous Feature ASP.NET Scripting Visual Basic .NET TOC VB ReferenceVB .NET Typographic and Code ConventionsVB .NET Runtime Library MembersVB .NET KeywordsVB.NET AttributesVB .NET Constants and EnumerationsVB .NET Data Type SummaryVB .NET DirectivesVB.NET FunctionsVB.NETModifiersVB .NET ModulesVB .NET NothingVB.NET ObjectsVB.NET OperatorsVB .NET Properties VB .NET QueryVB .NET Aggregate ClauseVB .NET Distinct ClauseVB .NET Equal ClauseVB .NET From ClauseVB .NET Group By ClauseVB .NET Group John ClauseVB .NET John ClauseVB .NET Let ClauseVB .NET Order By ClauseVB .NET Select ClauseVB .NET Skip ClauseVB .NET Skip While ClauseVB .NET Take ClauseVB .NET Take While Clause Draft for Information Only
ContentWhere Clause
Where ClauseSpecifies the filtering condition for a query.Syntax
PartsTermDefinition conditionRequired. An expression that determines whether the values for the current item in the collection are included in the output collection. The expression must evaluate to a Boolean value or the equivalent of a Boolean value. If the condition evaluates to True, the element is included in the query result; otherwise, the element is excluded from the query result.RemarksThe Where clause enables you to filter query data by selecting only elements that meet certain criteria. Elements whose values cause the Where clause to evaluate to True are included in the query result; other elements are excluded. The expression that is used in a Where clause must evaluate to a Boolean or the equivalent of a Boolean, such as an Integer that evaluates to False when its value is zero. You can combine multiple expressions in a Where clause by using logical operators such as And, Or, AndAlso, OrElse, Is, and IsNot. By default, query expressions are not evaluated until they are accessed—for example, when they are data-bound or iterated through in a For loop. As a result, the Where clause is not evaluated until the query is accessed. If you have values external to the query that are used in the Where clause, ensure that the appropriate value is used in the Where clause at the time the query is executed. For more information about query execution, see Writing Your First LINQ Query. You can call functions within a Where clause to perform a calculation or operation on a value from the current element in the collection. Calling a function in a Where clause can cause the query to be executed immediately when it is defined instead of when it is accessed. For more information about query execution, see Writing Your First LINQ Query.ExampleThe following query expression uses a From clause to declare a range variable cust for each Customer object in the customers collection. The Where clause uses the range variable to restrict the output to customers from the specified region. The For Each loop displays the company name for each customer in the query result.
The following example uses And and Or logical operators in the Where clause.
See alsoSource/Reference©sideway ID: 210500023 Last Updated: 5/23/2021 Revision: 0 Ref: ![]() References
![]() Latest Updated Links
![]() ![]() ![]() ![]() ![]() |
![]() Home 5 Business Management HBR 3 Information Recreation Hobbies 8 Culture Chinese 1097 English 339 Travel 18 Reference 79 Computer Hardware 254 Software Application 213 Digitization 37 Latex 52 Manim 205 KB 1 Numeric 19 Programming Web 289 Unicode 504 HTML 66 CSS 65 SVG 46 ASP.NET 270 OS 431 DeskTop 7 Python 72 Knowledge Mathematics Formulas 8 Set 1 Logic 1 Algebra 84 Number Theory 206 Trigonometry 31 Geometry 34 Calculus 67 Engineering Tables 8 Mechanical Rigid Bodies Statics 92 Dynamics 37 Fluid 5 Control Acoustics 19 Natural Sciences Matter 1 Electric 27 Biology 1 |
Copyright © 2000-2025 Sideway . All rights reserved Disclaimers last modified on 06 September 2019