I have an entity data model with two objects in it, Roles and Users. I have a navigation property, I have EntityDataSource and GridView. EntityDataSource points to a Users object and has an Include = "Roles" parameter.
I added a BoundField to the GridView, which points to RoleName, a property of object roles. However, when I execute the code, I get the above error.
I have successfully used very similar code in another application. Any ideas why this is not working?
Here is my EntityDataSource:
<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=pbu_checklistEntities" DefaultContainerName="pbu_checklistEntities" EnableDelete="True" EnableFlattening="False" EnableUpdate="True" EntitySetName="Users" Include="Role"> </asp:EntityDataSource>
And here is the BoundField:
<asp:BoundField DataField="RoleName" HeaderText="Role" SortExpression="RoleName" />
source share