Onnce you get all the values into datatable you can use linq query to get the required values
For less than 3 …dt.AsEnumerable.GroupBy(function(x) x(0).ToString).Any(function(x) x.Count<3) this gives true or false if atleast one value exists with count<3
And to bet all those values into separate datatble requireddt = dt.AsEnumerable.GroupBy(function(x) x(0).ToString).Where(function(x) x.Count<3).Select(function(x) x.First).CopyToDataTable