Quantcast
Channel: Shailendra Saxena
Viewing all articles
Browse latest Browse all 18

Basic LINQ Query

$
0
0




LINQ Queries



Basic LINQ Query Operators

From (Specify the Data Source)

In LINQ query first step is to specify the data source that you want to query.
Dim custdata = from  cust in customers
Filtering
Filtering the data. Query returns only those elements for which the expression is true.
Dim custdata = from  cust in customers                                            Where cust.city= “Delhi”
Ordering
Order by clause return the data in order which we asked for
Dim custdata = from  cust in customers                                            Where cust.city= “Delhi”
Order by cust.name ascending
Selecting
Select clause is used for specify the fields you want to incluse In the result.
Dim custdata = from  cust in customers                                            Where cust.city= “Delhi”
Order by cust.name ascending
Select cust.namr




Viewing all articles
Browse latest Browse all 18

Trending Articles