I'm able to loop through a list on sharepoint and get the information I need from selected columns, but how would I loop through a list and get only distinct values from a column in C#. For instance lets get all the distinct values from a the email column?
I know I can foreach through the list
foreach (SPListItem item in List.getItems(querysp)
{
var itemID = item.ID;
var itemEmail = item["email"];
...
//more vars here
...
}