我正在使用Linq to Entity
和Entity Datasource
。我有一个edmx
包含我所有表格的文件。我正在尝试在entity datasource
属性上使用包含功能。
<asp:EntityDataSource ID="EntityDataSource2" runat="server"
ConnectionString="name=sspEntities" DefaultContainerName="xxx"
EnableFlattening="False" EntitySetName="Employee_Financial"
Include="Bank_Branch,Employee_Personal_Info,COA" EnableDelete="True" >
</asp:EntityDataSource>
这是我的数据源之一的示例。
Text='<%# Eval("Employee_Personal_Info.Firstname") + " " + Eval("Employee_Personal_Info.Surname") %>'></asp:Label>
这就是我在我gridview
的(标签)中实现它的方式。
现在我可以这样做了,因为table A
(Employee_Financial) 在 (Employee_Personal_Info) 中有一个外键table B
。因此,我的include
陈述有效。
这是我的问题>< 使用我上面的示例。假设 table A
有一个外键,table B
并且在 a 中table B
有一个外键table C
。使用我gridview
以及entity datasource
如何使用该include
功能从表 C 中获取值。表 A 只能访问表 B(因此我可以从表 B 中获取值)但我需要表 C 中的值(并且我不能include
在我的表 Centity datasource
因为 A 和 C 没有链接)。