locked
Can't find reason for these errors RRS feed

  • Question

  • User-1215707945 posted

    So my page was working perfectly. Everything was showing in the details view. I decided to split the data between a detailsview and a gridview so I added a gridview and set the fields for both controls. The web page still viewed perfectly.
    I don't know if I accidently clicked something but now when I run the page from Visual Studio I get this strange error "Could not determine a MetaTable. A MetaTable could not be determined for the data source 'SqlSingleCRM' and one could not be inferred from the request URL. Make sure that the table is mapped to the data 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 have double checked the datasource, the connection string, the control fields and properties as well as looked for unused event handlers and can find no reason why it would stip working. I have refreshed the schema for the data source and for both control, I have also restarted Visual Studio.

    The stored procedure still runs perfectly when run in SSMS.

    When I step through the data source config to test it I now also get this error.
    There was an error executing the query. Please check the syntax of the command and if present, the types and values of the parameters and ensure they are correct. Failed to enable constraints. One or more rows contain values violating non-null, unique ar foreign key constraints

    Sunday, January 12, 2020 8:41 PM

Answers

  • User-1215707945 posted

    SOLVED:
    For some reason one of the fields in the Gridview was set to asp:DynamicField instead of asp:BoundField.
    I changed this and all is working again!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, January 12, 2020 9:25 PM