I have a data table dtStudent with structure as follows
Id | Name | Class | RoomNum | Subject
---------------------------------------
1 | ABC | 5 | 10 | Maths
1 | ABC | 5 | 10 | Science
1 | ABC | 5 | 10 | English
As You can see, it contains different data for subject column only.
Now, I want to get the value for class
and RoomNum
column. As the values are same for all rows, I am using following-
var stdDetails = from r in DtTable.AsEnumerable()
select new
{
Class = r.Field<string>("Class").ToString(),
RoomNum = r.Field<string>("RoomNum").ToString()
};
What to do next? I need the values 5 and 10. Any help?