c# - How to remove duplicate records from datatable based on condition -


i have c# datatable following data

name    marks   month lmn     22      current xyz     55      previous abcd    100     previous abcd    50      current 

i want remove duplicate names data if month column 'previous'.

example, here abcd having duplicate enteries want remove abcd having month 'previous'

so result datatable should like-

name    marks   month lmn     22      current xyz     55      previous abcd    50      current 

the approach thinking follow deplicate rows , check 'previous' column value , delete it. seems long cut way. or datarow.delete

can suggest simpler way this?


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

c++ - Using Gtest how return different values in ON_CALL? -

asp.net core mvc - How important is the global.json and src folder? -