0
我有兩個名爲StaticPages和StaticPagesContents的表,這兩個表與StaticSn一起從StaticPages和StaticID從StaticPagesContents一起傳播。 我需要從一個名爲PageContent StaticPagesContents閱讀領域,並顯示在我的控制之一這個數據,所以我用這個代碼:讀取實體框架中的相關數據
if (DropDownList1.SelectedIndex > -1)
{
using (shahedWSEntities myEntity = new shahedWSEntities())
{
var content = (from s in myEntity.StaticPages
where s.StaticSn == Convert.ToInt32(DropDownList1.SelectedValue)
select s);
if (!object.ReferenceEquals(content, null))
{
CKEditorControl1.Text=...
}
}
}
,但我不能訪問StaticPageContents的PageContent場。你可以幫我嗎?
非常感謝,這是正確的 –