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 131 | Next

Scott Klein

"Professional LINQ"

Items.Add(num);
The results are
1
2
3
4
5
6
7
8
9
10
68
Chapter 4: LINQ Standard Query Operators
To test this using LINQ, open a new query window in SQL Server Management Studio and select the
AdventureWorks database. Execute the following query:
SELECT SalesOrderDetailID, ProductID, UnitPrice
FROM Sales.SalesOrderDetail
WHERE SalesOrderID = 43662
ORDER BY UnitPrice
Your results would look like this:
Salesordetailid productid unitprice
--------------- --------- ---------
44 722 178.5808
49 738 178.5808
47 726 183.9382
43 729 183.9382
32 730 183.9382
34 725 183.9382
41 732 356.898
48 733 356.898
50 766 419.4589
40 763 419.4589
46 760 419.4589
35 762 419.4589
36 765 419.4589
37 768 419.4589
30 764 419.4589
31 770 419.4589
33 754 874.794
39 756 874.794
42 758 874.794
51 755 874.794
45 749 2146.962
38 753 2146.962
Notice that the unitprice column contains some duplicate values. With LINQ, you can use the same
Distinct operator as used in the previous example. Here??™s how:
var query =
from od in orderdetail
where od.


Pages:
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6