I have one table having ID and other attributes.
How can I get list of int of IDs by LINQ query on that table?
I have one table having ID and other attributes.
How can I get list of int of IDs by LINQ query on that table?
Use the Select method to project your result into a different format:
var myList = myTable.Select(t => t.ID).ToList();
That should do it, note you can also use the more SQL-like syntax:
var myList = (from t in myTable
select t.ID).ToList();
EDIT:
Also note, this is C# syntax, if you want a different syntax you need to clarify which language you're using.