Guest User

Guest User

  • Tech Writer
  • 77
  • 13k

convert string to boolean

Aug 7 2020 2:23 AM
Hi, wanna ask, how to change this code to accept boolean base on a string. 
 
I have a CSV file that has pressure column and I want to make it as a boolean if the value is 'pressure is ok' it will convert to boolean and save it to the database with 'pressure is ok' 
 
if (i == 0)
{
    cmd.Parameters.AddWithValue("pressure", columns[i]);
}
 
can somebody help me ?
Thank you
Using visual studio 2019,c#

Answers (1)