and correctly types the authorizedReviews variable as a generics type IQueryable(Of Review) in
VB.NET syntax or IQueryable in C#. Although this looks a little scary and incomprehensible
at fi rst, it becomes much easier to understand if you simply read it as “a bunch of Review objects
that you can access in queries.” In most cases you can also explicitly specify the return type of the variable
instead of using var or a Dim statement without a data type, but exceptions do exist, as you’ll see
later when anonymous objects are discussed.
These Review objects are then assigned to the DataSource property of the GridView. In previous chapters
you saw how to use the DataSourceID property to connect a control such as the GridView to a
data source control like the SqlDataSource. By using the DataSource property instead, you can assign
the actual data yourself, which the control then uses to build up the UI: