13.7. Exercises

  1. Imagine you have a page in the Reviews folder called MostRecent.aspx. This page shows the 10 reviews most recently added to the database. What would your LINQ query look like if you only wanted to show the review's Title property and the name of the genre it belongs to? You should use the Take method to limit the result set to 10. If you're having trouble writing the code to get the last reviews, look at the section titled "First, FirstOrDefault, Last, and LastOrDefault," which shows you how to get the last review in the database.

  2. What is the major benefit of the new ListView control over other data controls like GridView and Repeater?

  3. Currently the Default.aspx page from the PhotoAlbums folder just shows the thumbnails of the pictures. What would you need to do to display the full-size picture on its own page using a LINQ query?

Get Beginning ASP.NET 3.5: In C# and VB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.