Linq Query question regarding DT

I have a raw data excel, i want a datacolumn from that which should have uniquevalue. i can do it using for each row and adding in seprate column but i want to do it with the liq query, can someone help.

Hii @Shubham_Kinge ,
what i understood from your requirement is you want a particular column in your excel from which you should get only the unique value. If this is right then you can use below expression.


This will return the single column with the unique values.


1 Like

Try this one may be this will help you


1 Like

Hi @Shubham_Kinge ,

Check this below query to get unique rows based on a column,

dt_Grouped = (From d In dt_Input
Group d By k=d("Your Column Name").toString.Trim Into grp=Group
Select grp.First).CopyToDataTable()

Hope this may help you :slight_smile:


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.