views:

61

answers:

1

I need to get distinct department values where scope is people. I tried with Sharepoint full text query but this does not seem to return distinct values. Therefore, the only thing i can do is to get distinct values from the datatable. But this approach slows down the application when there are huge number of people belonging to a specific department as the department name repeats so many times as the number of people belonging to that department.

What can be the alternative?

Thanks,

+1  A: 

FullTextSqlQuery does not support DISTINCT operations. You could however use LINQ over the resulting DataTable:

IEnumerable<DataRow> distinctValues = 
    DataTable.Load(resulttable).AsEnumerable().Distinct(DataRowComparer.Default);
Colin