I have a field in DB which is float. My application is WindowsForm. I need to convert the value in textbox of the format 43.27 to double.
When I do this COnvert.ToDouble(txtbox.Text) I get exception saying input string is wrong format.
How to rectify this issue
I have a field in DB which is float. My application is WindowsForm. I
Share
Try specifying a culture when parsing:
And to handle the error case for gracefully instead of throwing exceptions around you could use the TryParse method: