how to get distinct record from DataView in C#?
Suppose you have data table with columns - Country,State,City.
And you want to distinct State then following code will help you:
DataTable tempDataTable = new DataTable (); DataTable tempDataTableDistinct = new DataTable (); DataView tempDataView = new DataView (tempDataTable); tempDataTableDistinct = tempDataView.ToTable( true , "ColumnName" );
The tempDataTableDistinct will contains the distinct State.