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

Scott Klein

"Professional LINQ"


The following example illustrates how LINQ works querying relational data, using a database as the
source of data.
6
Chapter 1: Project LINQ
var conQuery =
from c in contact
where c.FirstName.StartsWith("S")
orderby c.LastName
select new { c.FirstName, c.LastName, c.EmailAddress} ;
foreach (var item in conQuery)
ListBox1.Items.Add(item.FirstName + " " +
item.LastName + " " +
item.EmailAddress);
This previous example queries the Person.Contact table in the AdventureWorks database for all contacts
whose first name starts with the letter ??????S??™??™.
The purpose of LINQ is to provide developers with the following benefits:
??‘ A simplified way to write queries.
??‘ Faster development time by removing run-time errors and catching errors at compile time.
??‘ IntelliSense and debugging support for LINQ directly in the development language.
??‘ Closing the gap between relational data and object-oriented development.
??‘ A unified query syntax to use regardless of the source of data.
What is important to notice is the same syntax that you used to query the system processes was used
query a SQL data source.


Pages:
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6