Failed to determine metadata binding list for asp.net datagridview

I work with the following block of code ...

List<ThemeObject> themeList = (from theme in database.Themes
                            join image in database.DBImages on theme.imageID equals image.imageID
                            into resultSet
                            from item in resultSet
                            select new ThemeObject { Name = theme.Name, ImageID = item.imageID}).ToList();
dgvGridView.DataSource = themeList;
dgvGridView.DataBind();

The list object is populated in order. The data node is set to 2 columns.

  • Text field column for "Name" attached to "Name"
  • Image column mapped to ImageID field

When I execute the code, I get the following error in DataBind ()

Failed to determine MetaTable. MetaTable could not be defined for the data source, '' and one could not be inferred from the request URL. To do this, make sure that the table is mapped to the dats source, or that the data source is configured with a valid table type and name, or that the query is part of a registered DynamicDataRoute.

- dynamicdataroutes, . - ?

+3
1

, - Dynamic Data Entities ( , ), Page_Init:

dgvGridView.EnableDynamicData(typeof(ThemeObject));
+3

Source: https://habr.com/ru/post/1782090/