If statement not correct

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

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

Hi Arivu,

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


Kind regards,
Giovany

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

1 Like

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