我有一个数据库模式如下:
FailureItem
---------------
FailureID int foreign key references Failure (FailureID)
DatabaseID int NULL foreign key references Items (DatabaseID)
FailureDescription varchar(200)
Item
---------------
DatabaseID int primary key identity(1,1)
ItemDescription varchar(200)
我正在使用 linq 将其绑定到 gridview,如下所示:
Dim items as List(Of FailureItems) =
context.FailureItems.include("Item").where(function(x) x.FailureID = _failureID)
<asp:GridView ID="gv1" runat="server">
<Columns>
<asp:BoundField DataField="databaseID" Visible="false" />
<asp:BoundField DataField="FailureDescription" headertext="Failure Description" />
<asp:BoundField DataField="Item.ItemDescription" headertext="Item Description" />
</Columns>
</asp:GridView>
这在我的开发机器上完美运行。当我将它发布到 azure 上时,我收到错误“在所选数据源上找不到名为 'Item.ItemDescription' 的字段或属性”。我究竟做错了什么?