Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource. The error is displayed when I bind the grid view
var list = d
In my testing page I make us of the following piece of code to display a list of different objects or just a single object in the same gridview.
var data = bl.getAirlines();
// If single object returned cast to List
// Note that could be already a list of 1 item though!
if (data.Count == 1)
{
var list = new List
Hope it helps! It works for me :)