我有像14,15,18
这样的ProjectId列表,我想使用linq从我的数据表中搜索这些项目。如何在LINQ中使用IN运算符
现在我已经创建了像
IEnumerable<DataRow> drProjList = from a in dtProj.AsEnumerable()
where a.Field<int>("ProjectId")
.ToString()
.Contains(projFilter)
select a;
查询,但我没有得到0元素。
任何机构都可以建议我像linq中的IN
运算符。
在此先感谢
编辑 projFilter是有14,15,18,......项目IDS纯字符串。
'projFilter'是什么类型? – MarcinJuraszek 2012-04-03 06:59:11
@MarcinJuraszek其逗号分隔的一个字符串ProjectId的 – 2012-04-03 07:10:17