开发者

Convert object to int in Linq Where clause

I'm trying to query a collection where a value of a DataColumn is equal to a number. Problem is, I can't convert an object to an int within a Linq query.

The error fires within the where clause. Any suggestions?

Is there a special syntax I'm not aware o开发者_StackOverflow社区f?

var datos = _dttMasterViewTransaction.AsEnumerable().Where(r => r["JEID"] == FundsID).Select(r => new EntityJESummary()
{
    Test = r["test"]
}).ToList();


Special syntax? Does casting count?

_dttMasterViewTransaction.AsEnumerable().Where(r => (int)r["JEID"] == FundsID)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜