Could not determine metatable error binding list to asp.net datagridview
- by Scott Vercuski
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.
A textbox column for the "Name" which is bound to "Name"
An image column which is bound to the "ImageID" field
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?