SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 84 | Next

Scott Klein

"Professional LINQ"

It is called a generator,
and defines where the data will be coming from when the query is executed. It also specifies a range
variable that is used as a reference for each element in the data source. In the following example, contact
is the data source and c is the range variable:
from c in contact
The where clause enables you to filter the results being returned by the query. By applying a filter to the
query, you??™re not only limiting the number of rows returned, but you are specifying the rows you want to
see, or exclude, from the returned results. For example, the following returns only those contacts whose
first name begins with the letter S:
where c.FirstName.StartsWith("S")
37
Part I: Introduction to Project LINQ
Recall from Chapter 1 that you selected all the rows from the Person.Contact table in the
AdventureWorks database??”the table had nearly 20,000 rows. By simply applying this filter to the LINQ
query, the number of rows returned is just over 1,200??”quite a difference.
It is possible to apply multiple filters by using the logical operators AND and OR.


Pages:
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6