c# - How to not print duplicates in a data grid view using LINQ -


I have a table named Time and there are many students in it. Occasionally, student A will have more than one entry in TIME. How do I print the latest record for student A?

Do you want the latest student? .. then you need something like this: Datagram view. Data source = students. Group by (s => s.Name). Select (i = & gt; i.OrderByDescending (s = & gt; s.DateChanged). First ());

I here believe that you can sort them with some parameters (I used the date here. You may have some incremental primary key or smth).

Comments