At this moment i am trying to get a double value from textbox like this:
String.IsNullOrEmpty(textBox1.Text) ? 0.0 : Double.Parse(textBox1.Text)
But there is a problem, i cant get how to parse empty textbox?
For example if to try this code with OleDb and Excel with empty textbox, we will get error
System.FormatException: Input string was not in a correct format.
double val;
if(!double.TryParse(textBox.Text,out val))
val = 0.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With