How to identify if Double number found in particular column value

Hi Team,

I have one datattable i want to identify if double number found in particular column, This is always one row only

If found print yes found or print no

Double value example: "0.00 or 123.99 , 138.22, 129.55 , … " it will come in “cc” column if any of the double value found should print yes.

Please help me anyone for this.

image

Regards,
Raja G

Hi @Raja.G

Try this

isDoubleFound = dt.AsEnumerable().Any(Function(row) Double.TryParse(row("cc").ToString(), Nothing))

isDoubleFound variable datatype : Boolean

Input:

image

Regards,

1 Like

@Raja.G

isDoubleFound=dt.AsEnumerable().Any(Function(row) Double.TryParse(row("cc").ToString, New Double()))
isDoubleFound is boolean

if:isDoubleFound=True
Log Message :"Yes"

1 Like

Hi @Raja.G

Try this syntax:

result = If(dt.AsEnumerable().Any(Function(row) Double.TryParse(row("ccc").ToString(), Nothing)), "Yes", "No")

result is of DataType System.String

Regards

1 Like

Hi @lrtetala /@rlgandu ,

Thanks, Working as expected.

Regards,
Raja G

1 Like

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