Symptom:
You run your ASP.NET web application and get the following error:
Applies to:
- ASP.NET WebForms development (any .NET language).
How to reproduce:
- Put a GridView on your webform.
- Configure its DataSource to be an Object data source.
- In the select method options tab, you chose a method that takes a parameter.
- Compile and run the page (error above is displayed).
Solution:
- Let the GridView control know what the key field(s) is/are of your data source.
Thanks so much. This article saved the day!