Last post Jan 12, 2020 09:25 PM by QPR_JAY
Jan 12, 2020 08:41 PM|QPR_JAY|LINK
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
Jan 12, 2020 09:25 PM|QPR_JAY|LINK
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!