I would like to fetch datas with checking id with some numbers.
int r = 0;
var ask = from y in entity.sorulars
where y.soru_id == questionID[r]
select new { y.sorutipi_id };
foreach (var hold2 in ask)
{
questionTypeID[r] = hold2.sorutipi_id;
r++;
}
I use these codes but
"The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities."
error appears. I guess questionID[r]
is not supported in LINQ
so what should I type instead of it. Thank you
Try this way, declare var Id=questionID[r];
variable globally and pass the id
to your query
int r = 0;
var Id= questionID[r];
var ask = from y in entity.sorulars
where y.soru_id == Id
select new { y.sorutipi_id };
foreach (var hold2 in ask)
{
questionTypeID[r] = hold2.sorutipi_id;
r++;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With