我使用LINQ lambda表达式,如下所示:
int Value = 1;
qryContent objContentLine;
using (Entities db = new Entities())
{
objContentLine = (from q in db.qryContents
where q.LineID == Value
orderby q.RowID descending
select q).FirstOrDefault();
}
但是,我得到了以下错误:
无法将lambda表达式转换为类型“string”,因为它不是委托类型
发布于 2013-10-05 20:00:53
我认为这个系统类中缺少using System.Linq;
。
并将using System.Data.Entity;
添加到代码中
发布于 2013-12-06 15:26:27
在我的例子中,我必须添加using System.Data.Entity;
发布于 2014-11-11 15:27:39
我用它解决了我的案子
@Html.DropDownList(model => model.TypeId ...)
使用
@Html.DropDownListFor(model => model.TypeId ...)
将会解决这个问题
https://stackoverflow.com/questions/19197481
复制相似问题