I have a simple datatable with four columns and some datarows:
DataTable results = new DataTable();
results.Columns.Add("Wellbore", typeof(string));
results.Columns.Add("Date", typeof(DateTime));
results.Columns.Add("WB", typeof(string));
results.Columns.Add("factor", typeof(double));
I used Linq query to get "list of data rows" when "date=1/1/2017" as:
var AllRowsAtPlanningDate = results.AsEnumerable()
.Where(x => ((x.Field<DateTime>("Date") == PlanningDate))).ToList();
I would like to get "distinct" values in the "wellbore" column in AllRowsAtPlanningDate . I just want the List<string> and not list<datarows> again.
How to do that? I have been checking some examples here but to no avail.