How to get the max and least salary value from employee table using database?

How to resolve this?

Hi @aparna3010 ,

If you have the DataBase stored inside of a DataTable, then you may use the following code to convert it into an array (Min, Max)

(From d In DtDataBase.AsEnumerable
Let min = DtDataBase.AsEnumerable.Select(Function(s) CInt(“0” & s(1).ToString.Trim)).Min
Let max = DtDataBase.AsEnumerable.Select(Function(s) CInt(“0” & s(1).ToString.Trim)).Max
Select {min, max}).First.ToArray

image
image

Kind Regards,
Ashwin A.K

1 Like