Could not determine metatable error binding list to asp.net datagridview

Posted by Scott Vercuski on Stack Overflow See other posts from Stack Overflow or by Scott Vercuski
Published on 2010-12-25T15:47:15Z Indexed on 2010/12/25 15:54 UTC
Read the original article Hit count: 1435

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about LINQ