InnerException
You could expand the "InnerException" in the exception dialog when you're debugging through visual studio to see the inner exception or you could use ex.InnerException, though one thing you need to know is that InnerExceptions can go very deep.
InvalidCastException
Yes, that is expected. I figured you had your DataSource populated with the actual Product entries but apparently you've projected the data onto an IEnumerable of Anonymous Types.
Example:
var products = from p in db.Products where p.Price > 300 select new { Name = p.Name, Quantity = p.Quantity };
products will thus be an enumerable of an anonymous type which was generated using new {...}, which is why you weren't able to cast the data bound item to Product.
Solution
Instead of Selecting new { }, just select p.
Alternative
If your model is quite large and you really want to project to a type, make it a static type like so:
public class ProductVM {
public int ID { get; set; }
public String Name { get; set;}
}
and in your query:
var products = from p in db.Products select new ProductVM { ID = p.ProductID, Name = p.Name }
Then when you get the DataBoundItem cast it to ProductVM instead of Product.
P.S.: VM stands for ViewModel