Current code:
short s;
s = short.Parse(this.txtFields3.Text);
I've gone through with debugging, and can confirm that the txtField3.Text returns an actual value from the form.
Also tried:
s = short.Parse(this.txtFields3.Text, CultureInfo.InvariantCulture);
and,
s = Convert.toInt16(this.textFields3.Text);
EDIT: The value of the variable I'm trying to put into 's' here is "EMS".
and the value is something that fits into a short?
How about:
short s;
if (!short.TryParse(this.txtFields3.Text, out s)){
s = 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