Troy
Well-known member
- Joined
- Feb 7, 2005
- Messages
- 153
- Programming Experience
- 10+
I'm writing a configuration XML file and I'm setting these fields to save my information. My problem is I get an error. String was not recognised as valid Boolean.
[/SIZE]
The error occurs in the cbALLUD.checked statement.
The writeconfig saves the checked state as a string and the Boolean.Parse is supposed to convert the string back into a state for my checkbox.
VB.NET:
[/B]
[SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] WriteconfigValues()
ConfigOpt.SetOption([/SIZE][SIZE=2][COLOR=#a31515]"DBPath"[/COLOR][/SIZE][SIZE=2], TempPath)
ConfigOpt.SetOption([/SIZE][SIZE=2][COLOR=#a31515]"ALLUD"[/COLOR][/SIZE][SIZE=2], cbALLUD.Checked.ToString())
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] ReadConfigValues()
TempPath = ConfigOpt.GetOption([/SIZE][SIZE=2][COLOR=#a31515]"DBPath"[/COLOR][/SIZE][SIZE=2])
cbALLUD.Checked = [/SIZE][SIZE=2][COLOR=#0000ff]Boolean[/COLOR][/SIZE][SIZE=2].Parse(ConfigOpt.GetOption([/SIZE][SIZE=2][COLOR=#a31515]"ALLUD"[/COLOR][/SIZE][SIZE=2]))[/SIZE]
[SIZE=2]
The error occurs in the cbALLUD.checked statement.
The writeconfig saves the checked state as a string and the Boolean.Parse is supposed to convert the string back into a state for my checkbox.