If statement not correct

activities

#1

Dt4.Select("[Charging station name]=’"+strOutEvstation.ToString+"’")

I’m getting an error in the above annotation in the if statement
What I’m trying to do is to find in one column called Charging station name the selected name from input box dropdown the output is called strOutEvstation


#2

Hi @Giovany,
Use below code to check the value exists or not using if condition.
Dt4.Select("[Charging station name]='"+strOutEvstation.ToString+"'"). length>0

Regards,
Arivu


#3

Hi Arivu,

I have changed the statement and now I’m getting the following error


Kind regards,
Giovany


#4

Hi @Giovany,

Make sure the datatable is not null and having that column name.
Dt4.Select("[Charging station name]='"+strOutEvstation.ToString+"'").length>0

Regards,
Arivu


#5

Make sure you have initialized the Datatable and Column value which you are checking should not be null