【发布时间】:2010-08-06 03:07:59
【问题描述】:
XElement xml = new XElement("MyMenu",
from c in db.Security_Module_Menus
//where (c.ParentID == 0)
orderby c.Menu_ID
select new XElement("Item",
new XAttribute("Text", c.Menu_Name), new XAttribute("NavigateUrl", c.Target_URL)
)
);
根据我上面的语法 c.Menu_Name,c.Target_URL 值可以为空。显示错误
值不能为空。 参数名称:value我知道SetElementValue()用来解决这个错误。但是我如何使用我上面的语法。帮我使用它。给我看语法
【问题讨论】:
标签: linq linq-to-xml