Click here to Skip to main content
16,005,169 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Dear friends,

I have to select "Distinct" Values from a column in DataView.
Also I want to remove empty rows from the dataview....


Please friends help me ...

Thanks in advance
Posted

1 solution

Hi,

You can use Lambda Expression for this.
Suppose the data you want to get from the grid is of type int.
Then initialize a List<int>, like List<int> list = new List<int>
Then add all the rows of the column to this list.
Then try list.Distinct().ToList()
This list will give the required distinct values

Happy Coding
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900