The top of page 7 has a sample fragment. I wanted to make it run, so I looked at the download code. But that part was commented out. Can someone tell me what code is needed to execute the query? Instead of putting the output in a list box, how about just writing it to the console?
Code:
DataContext context = new DataContext("Initial Catalog=AdventureWorks;Integrated Security=sspi");
//Table<Contact> contact = context.GetTable<Contact>();
//var query =
// from c in contact
// where c.FirstName.StartsWith("S")
// && c.LastName.StartsWith("A")
// orderby c.LastName
// select new { c.FirstName , c.LastName, c.EmailAddress };
//IEnumerable<Contact> query =
// from c in contact
// where c.FirstName.StartsWith("S")
// && c.LastName.StartsWith("A")
// orderby c.LastName
// select new { c.FirstName, c.LastName, c.EmailAddress };
//IEnumerable<Contact> query = contact.Where(a => a.FirstName.StartsWith("S") && a.LastName.StartsWith("A")).OrderBy(a => a.LastName);
//foreach (var item in query)
// listBox1.Items.Add(item.FirstName + " " + item.LastName + " " + item.EmailAddress);