How to get the unique value from a column if there is an single value into it

I have been using an Excel file where i have to fetch the unique value from a column , there is an single value into it , I have tried using it but its not been working in my case

Code i have been using
image

String1 = dt.AsEnumerable.Select(Function(x)x(“Value2”).ToString).Distinct.First

Please suggest how can i get it , Using the above i am getting the blank value

Hi,

Can you try the following expression?

String1= dt.AsEnumerable.Where(Function(x) Double.TryParse(x(“Value2”).ToString,New Double)).First().Item("Value2").ToString

Regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.