The following query complains that the int conversion is not supported.
var list = from d in data
where d.Id == (int)GridView1.DataKeys[0].Value
select d;
It complains on the (int)GridView1.SelectedInex line telling me that the Int conversion is not supported. I also tried Convert.ToInt32, but that did not work either.
Is this logic that has to be calculated before such as above the linq query or is there a special way to do it and if not, why does it not support it?
Why not try and parse the value to an integer before hand, it’s not needed in the query.