I am working 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 populates fine. The datagrid is setup with 2 columns.
When I execute the code I receive the following error on the DataBind()
Could not determine a MetaTable. A MetaTable could not be determined for the data source '' and one could not be inferred from the request URL. Make sure that the table is mapped to the dats source, or that the data source is configured with a valid context type and table name, or that the request is part of a registered DynamicDataRoute.
I'm not using any dynamicdataroutes as far as I can tell. Has anyone experienced this error before?
Assuming you are developing a Dynamic Data Entities web application (that's what the error you provided hints about), try this in your Page_Init
:
dgvGridView.EnableDynamicData(typeof(ThemeObject));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With