Reputation: 36743
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 of?
var datos = _dttMasterViewTransaction.AsEnumerable().Where(r => r["JEID"] == FundsID).Select(r => new EntityJESummary()
{
Test = r["test"]
}).ToList();
Upvotes: 0
Views: 2745
Reputation: 136124
Special syntax? Does casting count?
_dttMasterViewTransaction.AsEnumerable().Where(r => (int)r["JEID"] == FundsID)
Upvotes: 3