CarData1.Malaysia      =   bool.Parse(radioMalaysia.Checked.ToString());

// this is your bool        //this is your string converter

Description 

  1. above coding i use for “RadioButton” toolbox.
  2. “bool” coding use for several toolbox such as “RadioButton” and “CheckBox”.
  3. this coding also can be use for this error ” Cannot Impicitly type ‘string’ to ‘bool’ “.
  4. this coding mostly use during writing Open and Save button.

2 thoughts on “Convert String to Bool

Leave a Reply