locked
Error when trying to use Dynamic Data on a standard ASP.net page RRS feed

  • Question

  • User1737159284 posted

    I am trying to get Dynamic Data working on a page.  I have added an EntityDataSource, GridView and DynamicDataManager and set the ControlID of the DDM to the GridView.  However when I run the page I am getting the following error:


    Could not determine a MetaTable. A MetaTable could not be determined for the data source 'EntityDataSource1' 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.

    Has anyone had this error and where should I be looking for a fix?


    Regards,


    Dave


    Wednesday, February 17, 2010 5:28 AM

Answers

  • User1737159284 posted

    OK, It seems that the fix for this error is to add the following line to the Page Init :  


    EntitiyDataSource1.ContextType = GetType(MyEntities)



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 17, 2010 9:14 AM

All replies

  • User1737159284 posted

    OK, It seems that the fix for this error is to add the following line to the Page Init :  


    EntitiyDataSource1.ContextType = GetType(MyEntities)



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 17, 2010 9:14 AM
  • User530735299 posted

    For those that get the following error and are not using dynamic data:

    Could not determine a MetaTable. A MetaTable could not be determined for the data source 'DataSourceNameHere' 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. 

    If you are using visual web developer 2010, if the columns change in your database or you add columns to a gridview based on a column that web developer is not aware of, it may add the gridview column as a dynamic data column.  You may recieve this error.  Configure your gridviews and make sure to 'refresh the schema' before removing and re-adding any columns that were in the gridview as dynamic data columns (they have a different icon).  I couldn't find this answer on any other forum.

    Tuesday, May 4, 2010 1:30 PM
  • User-1103344360 posted

    If still not working, make sure you registered the ADO.NET Entity Framework model for ASP.NET Dynamic Data in Global.asax by uncommenting the following line and plugging in your context name.

    DefaultModel.RegisterContext(typeof(YourContext), new ContextConfiguration() { ScaffoldAllTables = false });

    Wednesday, June 30, 2010 10:05 AM