I have a datatable and I want filter this datatable based on list of values and get only mentioned columnsin the output along with one conditional value in column.
so I am using this query by which I am able to filter datatable based on list of values but It doesnt It returns all column and cant assign conditional value
so I am using other query but it returns no datat row
(From d In dt.AsEnumerable Where arrRefList3.Contains(d(“Ref.”).ToString)
Let sd = d(“Sales”).toString
Let pa = d(“Partner”).toString
Let sw = d(“Purchase No.”).toString.Trim
Let f = If(d(“Appointment”).ToString.ToLower.Contains(“sb”), “2”, “3” )
Let ra = New Object(){sd,sw,pa,f}
Select dt1.Rows.Add(ra)).CopyToDataTable
this is returning no rows
(From d In dt.AsEnumerable.Where(function (x) arrRefList3.Contains(x("Ref.").ToString))
Let sd = d("Sales").toString
Let pa = d("Partner").toString
Let sw = d("Purchase No.").toString.Trim
Let f = If(d("Appointment").ToString.ToLower.Contains("sb"), "2", "3" )
Let ra = New Object(){sd,sw,pa,f}
Select dt1.Rows.Add(ra)).CopyToDataTable
if it is not working please share some data samples with us. Thanks