i have the following code which will get the max and min values from a list of type double
Dim sprices As List(Of Double) = grp.ProductGroups.AsEnumerable().[Select](Function(sm) sm.Field(Of Double)("sprice")).Distinct().ToList()
Dim min As Integer = sprices.Min()
Dim max As Integer = sprices.Max()
how ever in the first line i get the exception “Cannot cast DBNull.Value to type ‘System.Double’. Please use a nullable type.”
how can i avoid this or not add the DBNulls to the list?
One way is to use a nullable
Double, which can be expressed asDouble?: