Simon Simon - 1 year ago 71
SQL Question

Search Distinct values in DataTable

I have a datatable that has a few thousand rows, there are three columns and I want to search the one specific column in the datatable to find the Distinct values. I have tried this:

DataRow[] dr = datatable.Select("SELECT DISTINCT Amount ");

Amount is the column name that I am trying to group the values by.

The error I get is:
Syntax error: Missing operand after 'DISTINCT' operator


  DataView view = new DataView(datatable);
  DataTable distinctAmount = view.ToTable(true, "Amount", "xxx","xxxx"...);

enter image description here