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

Scott Klein

"Professional LINQ"


DataContext context = new DataContext("Initial Catalog =
AdventureWorks;Integrated Security=sspi");
Table contact = context.GetTable();
Dictionary dict = contact.ToDictionary(con => con.FirstName);
foreach (KeyValuePair item in dict)
listBox1.Items.Add(item.Key + " " + item.Value.FirstName + " " +
item.Value.LastName);
The following list shows the partial results of running this query:
1 Gustavo Achong
2 Catherine Abel
3 Kim Abercrombie
4 Humberto Acevedo
5 Pilar Ackerman
6 Frances Adams
7 Margeret Smith
8 Carla Adams
ToList
The ToList operator converts an IEnumerable sequence collection to a List(Of T). It also forces immediate
execution of the query. The following code uses the ToList operator to query the first names from
the Person.Contact table and return the results as a List(Of T).
DataContext context = new DataContext("Initial Catalog =
AdventureWorks;Integrated Security=sspi");
Table contact = context.GetTable();
var query = (from c in contact
select c.


Pages:
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6