Well...yes. It is.
Look at the message:
'query' is a 'variable' but is used like a 'method'
Then look at how you create and use
query
:
var query = (a.Std_info.Join(a.Catg_type, stdtable => stdtable.Catg_id,
...
})).ToList();
...
res2 += query(yearP);
query
is a List<T> of an anonymous type.
You can't use a list as a method!
I'm not sure what the heck you are trying to do here, but...it's not a method,
yearP
isn't shown, so it could be an index into the list in which case you'd want:
res2 += query[yearP];
But that wouldn't work either because the anonymous type doesn't have a addition operator...