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

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -