I am performing a query in an database using linq-to-sql to retrieve a DataTable in C#. Now, in this DataTable, I want to find how many categories I have in a specific columns. Let's say the column's name is "Variable" and the values for the different rows would be for example:
["a", "a", "a", "b", "b", "c", "c", "c", "c"]
I just want to know what categories this column contain. So in this case that would be the categories "a", "b", and "c".
This would be done easily in R using levels(DataTable$Variable).
But how to do that in C# ?
Thanks